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;
|
|
|
|
|
|
|
|
|
|
|
|
connection string, connection strings, SQL, SQL ODBC connection strings, SQL OLE DB connection strings, SQL OleDbConnection .NET strings, SQL SqlConnection .NET strings
Leave a Reply