MS VBA AODBC Run-time Error
Posted on 2007-03-26
I'm trying to use the Microsoft ActiveX Data Objects 2.8 Library to establish a connection to a Sybase database. I have successfully used the XLODBC.XLA driver on the same computer, so I believe the ODBC connection is set up properly. This is using Excel 2000 and Windows 2000 Professional.
I am getting the following error when I try to set the connection:
Run-time error '-2147024769 (8007007f)':
The specified procedure could not be found.
However, the library is selected in the VBA References list. Here is my code; the error is generated on line 13 (commented accordingly):
Dim uidA, pwdA As String
dsnA = InputBox("Data Server Name:")
uidA = InputBox("DB User ID:")
pwdA = InputBox("DB Password:")
Dim conn As ADODB.Connection
Dim connStr As String
Dim rs As ADODB.Recordset
connStr = "DSN="& dsnA & ";UID=" & uidA & ";PWD=" & pwdA & ";"
Set conn = New ADODB.Connection '<---- This is the line that generates the error message
Set conn = Nothing
Does anyone know what might be causing this error? Thanks in advance for the help.