princessk1
Programmer
I am trying to connect to the database through an ODBC connection and I am getting the error:
'Run-time error 3146 - ODBC - call failed'
This is the code I am using. I am using the same code with different variable names for the workspace and the connection to connect to a differenct Database and it works fine.
ConnectStr = "ODBC;DATABASE=" + Database + ";UID=" + UserName + ";PWD=" + Password + ";DSN=" + DSN + ";"
Set ws1 = CreateWorkspace("w1", UserName,Password,dbUseODBC)
Set cnn = ws1.OpenConnection("Connection2",dbDriverNoPrompt, , ConnectStr)
The variables are filling with the right values.
Any ideas?
'Run-time error 3146 - ODBC - call failed'
This is the code I am using. I am using the same code with different variable names for the workspace and the connection to connect to a differenct Database and it works fine.
ConnectStr = "ODBC;DATABASE=" + Database + ";UID=" + UserName + ";PWD=" + Password + ";DSN=" + DSN + ";"
Set ws1 = CreateWorkspace("w1", UserName,Password,dbUseODBC)
Set cnn = ws1.OpenConnection("Connection2",dbDriverNoPrompt, , ConnectStr)
The variables are filling with the right values.
Any ideas?