SQL Server Connection

mlr0911

Registered User.
Local time
Today, 12:50
Joined
Oct 27, 2006
Messages
155
Hello, I was hoping someone could help me with a SQL connection issue I'm having. I'm trying to automate a database that will run on a server without having to input my password everytime it needs to run...I'm trying to use the SQL Driver connection string:
Code:
Driver={SQLServer};Server=[server name];Database=[DB name];Uid=[ID];Pwd=[Password];
I'm not able to get the above info to work in my code:
Code:
Dim SQLSvr As String
Dim db As DAO.Database
Dim rf As TableDef

Set db = CurrentDb

Driver={SQLServer};Server=[server name];Database=[DB name];Uid=[ID];Pwd=[Password];

DoCmd.OpenQuery "MyQuery"

End Sub

When my query executes, it still prompts me for my password. Any help would be greatly appreciated.

Thanks for your help.
 
Hello all...is there another option that I should be looking into?

Thanks
 
If MyQuery is a passthrough query, you can save the password in the connection string property.
 
Hi pbaldy, thank you for the reply. With your suggestion, I was able to convert my query to a passthrough query and execute without having to enter my user name and password everytime.
 

Users who are viewing this thread

Back
Top Bottom