I'm trying to connect to an Oracle 8i Db via Acces using ODBCDirect. My code (located in a module) is :-
Sub CreateConnection()
Dim wrkODBC As Workspace
Dim ConnOracle As Connection
Dim strCon As String
' Define Connection String
strCon = "ODBC;DSN=dev;UID=scott;PWD=tiger"
'Define ODBC Workspace
Set wrkODBC = CreateWorkspace("DEV", "scott", "tiger", dbUseODBC)
'Define ODBC Connection
Set ConnOracle = wrkODBC.OpenConnection("DEV", dbDriverComplete + dbRunAsync, False, strCon)
MsgBox "Connection Made to" & dsn
End Sub
However, when I try and run this, the program errors on the
Set ConnOracle = wrkODBC.OpenConnection("DEV", dbDriverComplete + dbRunAsync, False, strCon) line. The error is "Run-time error 13: Type Mismatch".
Can anyone see what I'm doing wrong (or not doing at all)....it's driving me mad !!
Thanks in advance
Sub CreateConnection()
Dim wrkODBC As Workspace
Dim ConnOracle As Connection
Dim strCon As String
' Define Connection String
strCon = "ODBC;DSN=dev;UID=scott;PWD=tiger"
'Define ODBC Workspace
Set wrkODBC = CreateWorkspace("DEV", "scott", "tiger", dbUseODBC)
'Define ODBC Connection
Set ConnOracle = wrkODBC.OpenConnection("DEV", dbDriverComplete + dbRunAsync, False, strCon)
MsgBox "Connection Made to" & dsn
End Sub
However, when I try and run this, the program errors on the
Set ConnOracle = wrkODBC.OpenConnection("DEV", dbDriverComplete + dbRunAsync, False, strCon) line. The error is "Run-time error 13: Type Mismatch".
Can anyone see what I'm doing wrong (or not doing at all)....it's driving me mad !!
Thanks in advance