Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run-time error 3146 - ODBC-call failed

Status
Not open for further replies.

OraMs

Programmer
Feb 12, 2000
40
US
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:
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

NOTE: I've posted this on the ODBC forum but have had no responses so hopefully someone from this forum would be able to provide some information...

Thanks
 
Have you tried linking to the tables manually through the ODBC to ensure that the ODBC is working properly?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top