Search code examples
vb6runtime-errorodbcdatabase-connection

How to solve RunTime error 3146: ODBC --call failed in vb6.0 code?


I am working on a vb6.0 application. Everything was fine then out of the blue I get the error :
RunTime error 3146: ODBC --call failed ,when I try to connect the application to the db.

    Public W As Workspace
    Public C As Connection
    Set W = CreateWorkspace("NewODBCWorkspace", Id, Password, dbUseODBC)
    Set C = W.OpenConnection("", dbDriverNoPrompt, False, OdbcConnectString)

The error occurs at the OpenConnection line. Can somebody help I really don't know why this happened.


Solution

  • It was a problem with my internet connection. The moment I changed my connection to a more stable one the error went away.