A
Adrian T
Hello:
This is something I have never done before. I am trying to have an open
connection with a SQL database registered in my machine's ODBC driver. Here's
my code
Private Sub Connect()
Dim wrkODBC As Workspace
Dim conData As Connection
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "", dbUseODBC)
Set conData = wrkODBC.OpenConnection("Connection1", , ,
"ODBC;DATABASE=Sale;UID=sa;PWD=sa;DSN=SQL_SERVER")
End Sub
When I run the code, an error msg says "Run-time Error:13 (Type Mismatch)".
I am almost convinced that it has something to do with referencing to the
right library. Does anyone know how to fix this?
Thanks!
This is something I have never done before. I am trying to have an open
connection with a SQL database registered in my machine's ODBC driver. Here's
my code
Private Sub Connect()
Dim wrkODBC As Workspace
Dim conData As Connection
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", "", dbUseODBC)
Set conData = wrkODBC.OpenConnection("Connection1", , ,
"ODBC;DATABASE=Sale;UID=sa;PWD=sa;DSN=SQL_SERVER")
End Sub
When I run the code, an error msg says "Run-time Error:13 (Type Mismatch)".
I am almost convinced that it has something to do with referencing to the
right library. Does anyone know how to fix this?
Thanks!