Dim sqlConnect As String
Dim sqlConnection As ADODB.Connection
sqlConnect = "Provider = SQLOLEDB.1;Data Source=[datasource];Initial Catalog=[databasename];User ID=[username];Password=[password];"
'datasource = the name of the requested SQL server instance
'databasename = the name of the requested database
'username = a valid username who has access to the requested database
'password = relevenat password of valid user
Set sqlConnection = New ADODB.Connection
sqlConnection.ConnectionString = sqlConnect
sqlConnection.Open
Return