In Access 2007, when I attempt to read from an Oracle database, I get the following message: Error 3847 - odbcDirect is no longer supported. Change your code to use ADO instead of DBO.
I am attempting to change the code from:
Dim sql as string
Dim rsProv As Recordset
Dim OraD As Database
Dim wksOracle As Workspace
Set wksOracle = CreateWorkspace("ODBCWorkSpace", "admin", "", dbUseODBC)
Set OraD = wksOracle.OpenDatabase("Oracledatabase", , True, ConnString)
sql = "(select certain fields from filename)"
Set rsProv = OraD.OpenRecordset(sql)
To:
Dim sql as string
Dim rsProv As ADODB.Recordset
Dim OraD As ADODB.Connection
Dim wksOracle As Workspace
sql = "(select certain fields from filename)"
Set rsProv = New ADODB.Recordset
rsProv.Open sql, OraD, adOpenStatic, adlockbatchoptimistic
When I try to run it, I get the following message: Error 3709 - The connection cannot be used to perform this operation. It is either closed or invalid in this context.
If anyone has any tips on how to get it to run, I will appreciate it very much.
I am attempting to change the code from:
Dim sql as string
Dim rsProv As Recordset
Dim OraD As Database
Dim wksOracle As Workspace
Set wksOracle = CreateWorkspace("ODBCWorkSpace", "admin", "", dbUseODBC)
Set OraD = wksOracle.OpenDatabase("Oracledatabase", , True, ConnString)
sql = "(select certain fields from filename)"
Set rsProv = OraD.OpenRecordset(sql)
To:
Dim sql as string
Dim rsProv As ADODB.Recordset
Dim OraD As ADODB.Connection
Dim wksOracle As Workspace
sql = "(select certain fields from filename)"
Set rsProv = New ADODB.Recordset
rsProv.Open sql, OraD, adOpenStatic, adlockbatchoptimistic
When I try to run it, I get the following message: Error 3709 - The connection cannot be used to perform this operation. It is either closed or invalid in this context.
If anyone has any tips on how to get it to run, I will appreciate it very much.