In attempting to open an ODBC connection from Access 97 to Oracle databases, I get the above error. This occurs during an OPENCONNECTION and an OPENDATABASE. Below is the code I'm using:
TIA
Code:
Function AddRows()
' Declare Variables
Dim wrkODBC As Workspace
Dim dbConn1 As Connection
Dim dbConn2 As Connection
' direct to error handler
On Error GoTo Error_handler
' Create an ODBCDirect workspace. Until you create
' Microsoft Jet workspace, the Microsoft Jet database
' engine will not be loaded into memory.
Set wrkODBC = CreateWorkspace("ODBCWorkspace", "admin", _
"", dbUseODBC)
'set connection to DB1 in read/write mode
Set dbConn1 = wrkODBC.OpenConnection("Conn1", , , _
"ODBC;DATABASE=DB1;UID=username;PWD=password;DSN=DB1DSN")
'set connection to DB2 in read only mode
Set dbConn2 = wrkODBC.OpenConnection("Conn2", , True, _
"ODBC;DATABASE=DB2;UID=username;PWD=password;DSN=DB2DSN")
wrkODBC.Close
Exit Function
Error_handler:
Err.Raise Err.Number
End Function
TIA