odbc connectivity

odbc connectivity

[php]
Sub ConnectionExample1()
Dim cnn As ADODB.Connection
Set cnn = New ADODB.Connection
‘ Open a Connection using an ODBC DSN named "Pubs".
cnn.Open "Pubs", "MyUserName", "MyPassword"
‘ Find out if the attempt to connect worked.
If cnn.State = adStateOpen Then
MsgBox "Welcome to Pubs!"
Else
MsgBox "Sorry. No Pubs today."
End If
‘ Close the connection.
cnn.Close
End Sub
[/php]

Tags:

Request a Free SEO Quote