Access 2003 DAO Connections
Hi,
I'm using Access to create some reports that use tables linked to SQL database. I'm prompted for a SQL password every time I run a query or report and wanted to automatically assign the UID and Password so the user doesn't have to enter a password. I've played around with this code but I think I need DAO commands?
Can someone tell me how to change this ADO command into DAO command
Set cnAptify = New ADODB.Connection
With cnAptify
.ConnectionString = "DSN=DevAp;UID=sa;PWD=P123;"
.Open
End With
Thanks much.
Re: Access 2003 DAO Connections
Re: Access 2003 DAO Connections
I use the next ADO code without problems
Code:
Dim MiConStr1 As String
MiConStr1 = "Provider=SQLOLEDB.1;" & _
"UID=MyUserName;" & _
"PWD=MyPassword;" & _
"Persist Security Info=False;" & _
"Initial Catalog=DBName;" & _
"Data Source=ServerName"
Set MiSQL1 = New ADODB.Connection
MiSQL1.CursorLocation = adUseClient
MiSQL1.ConnectionString = MiConStr1
MiSQL1.Open
Re: Access 2003 DAO Connections
Quote:
Originally Posted by jggtz
I use the next ADO code without problems
Code:
Dim MiConStr1 As String
MiConStr1 = "Provider=SQLOLEDB.1;" & _
"UID=MyUserName;" & _
"PWD=MyPassword;" & _
"Persist Security Info=False;" & _
"Initial Catalog=DBName;" & _
"Data Source=ServerName"
Set MiSQL1 = New ADODB.Connection
MiSQL1.CursorLocation = adUseClient
MiSQL1.ConnectionString = MiConStr1
MiSQL1.Open
The OP wants DAO. :)
Re: Access 2003 DAO Connections
Yes I know, but He wants DAO because he has problems with ADO
I think it's better to first try to resolve the problem using ADO instead of change to DAO