vba sql server connection
Hi,
i need to connect to a SQL Server db using an odbc data source and SQL
Server authentication. When i create the data source from the control
panel i set up the authentication with the SQL Server authentication
providing my id and pass.
The problems comes when i open the connection in the vba macro in
excel. it doesn't retrieve the informations about user and pass from
the data source and i don't want to put user and pass in the macro code
for security reasons...
The code of the connection setup:
cn.Open "PROVIDER=MSDASQL; DSN=data_source_name; DATABASE=db_name;
UID=; PWD=;"<---- these parameters are needed even if i've put them in
the data source definition.
Thanks for any hint!
Massimo
.
Relevant Pages
- Problem with SQL Server authentication
... In VB2005, I want to Add a Data Source, and use the Reporting1 user. ... I tick to Use SQL Server Authentication, ... (microsoft.public.dotnet.framework.adonet) - Starting with VB2005 and SQL Server 2008 Express Edition
... Writing a VB application to connect to SQL Server 2008 Express to handle the data entry instead of using Access. ... However I'm finding it difficult to try out SQL Server 2008 Express to connect to a database from VB. ... When I click this it opens a window that asks me to choose a data source type. ... The next screen asks me to choose a data connection. ... (microsoft.public.vb.database) - Re: Access 2003 - ODBC File Data Source - Relink every Access Sess
... Click on System DSN, click Add, select SQL Server, click Finish. ... titled "Create a New Data Source to SQL Server." ... "SQL Server Login" pops up, with the Data Source and then the name I called ... "Use Trusted Connection" is unchecked. ... (microsoft.public.data.odbc) - Re: Populating mail merge doc with data from MSsql 2K table
... > the MS Query option in Word - when you get to the Select Data Source ... Enter the name of the Windows computer that is running SQL Server ... Word should now create the .odc file and select it as the data source. ... if you did not sleect Windows Authentication and you did not ... (microsoft.public.word.mailmerge.fields) - RE: Use of IF then Else syntax in Access
... Is this being used in a query? ... this is referring to a field in the query's data source. ... that means using the SQL Server T-SQL syntax, ... (microsoft.public.access.queries) |
|