Sub CreateConnectionIntegrated()
'Declare and instantiate the connection
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
'Open the connection
cnn.Open "Provider=SQLOLEDB.1;" & _
"Data Source=(local); Initial Catalog=NorthWind;" & _
"Integrated Security=SSPI"
'Close the connection
cnn.Close
'Destroy the connection object
Set cnn = Nothing
End Sub
|