Sub Connect_ToSQLServer2()
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
With conn
.Open "Provider=SQLOLEDB;" & _
"DataSource=mySource;" & _
"Initial Catalog=myDb;" & _
"UID=myId; Password=myPassword;"
.Close
End With
Set conn = Nothing
End Sub