RSS

SQL Server connection strings

Tue, Aug 12, 2008

Connection Strings

This is a compiled connection strings reference list on how to connect to SQL Server.

ODBC

Standard Security

Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;

Trusted connection

Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Trusted_Connection=Yes;

Prompt for username and password

This one is a bit tricky. First you need to set the connection object’s Prompt property to adPromptAlways. Then use the connection string to connect to the database.

oConn.Properties(”Prompt”) = adPromptAlways Driver={SQL Server};Server=myServerAddress;Database=myDataBase;

, , , , , ,

Leave a Reply