|
-
Feb 2nd, 2009, 06:02 PM
#1
Thread Starter
Lively Member
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.
-
Feb 2nd, 2009, 06:12 PM
#2
Re: Access 2003 DAO Connections
-
Feb 2nd, 2009, 08:29 PM
#3
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
-
Feb 3rd, 2009, 06:55 AM
#4
Re: Access 2003 DAO Connections
 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.
-
Feb 3rd, 2009, 03:01 PM
#5
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|