Specifying Connection Properties
It is also possible to supply much of the information specified by a connection string by setting properties of the Connection object before opening the connection. For example, you could achieve the same effect as the connection string above by using the following code:
With objConn
.Provider = "SQLOLEDB"
.DefaultDatabase = "Northwind"
.Properties("Data Source") = "MySqlServer"
.Properties("Integrated Security") = "SSPI"
.Open
End With
Note In ADO you must not use a password containing semicolons (";") unless the password is enclosed in single quotes.