Error 3847:"...Rewrite code to use ADO instead of DAO"

P

Pierre Doré

Migrated this MS ACCESS 2002 to 2007 with the .mdb format. Application
starts but when I initiate a command button that runs code to connect to
ORACLE I get the following error message:

ODBCDirect is no longer supported. Rewrite the code to use ADO instead
of DAO. [3847]

Here is an extract of the code where it fails:

Set gWorkspace = CreateWorkspace("ODBCWorkspace", "ACIIS_ADMIN",
"aciis8adm", dbUseODBC)
gWorkspace.DefaultCursorDriver = dbUseODBCCursor
Set db_ACIIS_ORACLE = gWorkspace.OpenDatabase("ACIIS", dbDriverComplete,
False, "ODBC;UID=" & "ACIIS_ADMIN" & ";PWD=" & "xxxxx" & ";DSN=ACIIS")

Call PULL_OLTF_TO_ACIIS_ACCESS
LAST_SYNCH__START_TIME = Now()
Me.Start_run_txt.Value = LAST_SYNCH__START_TIME

Call Truncate_Oracle_ACIIS_TABLES


Call PUSH_PERSON_TO_ORC
Call PUSH_AC_TO_ORC
Call PUSH_MODULE_TO_ORC
...
...
Here is a very small extract of the PUSH_MODULE_TO_ORC Subroutine:

Private Sub PUSH_MODULE_TO_ORC()
On Error GoTo PUSH_MODULE_TO_ORC_ERROR

ccontext = "In PUSH_MODULE_TO_ORC"



Shell "explorer G:\ACIISDB" ' Activate the link between server WHQ11 and
hqclfs

Dim tmp_rs As Recordset
Dim RecCounter As Double
...
...
'These are the VALUES to be INserted in ORacle
sqlins = sqlins & " values(" & _
MDB_MODULE_CD & ", " & _
MDB_mod_of_day & ", " & _
MDB_start_dt & ", " & _
MDB_module_template_cd & ", " & _
MDB_module_lang & ")"

db_ACIIS_ORACLE.Execute (sqlins)
 
S

Stefan Hoffmann

hi Pierre,
Migrated this MS ACCESS 2002 to 2007 with the .mdb format. Application
starts but when I initiate a command button that runs code to connect to
ORACLE I get the following error message:

ODBCDirect is no longer supported. Rewrite the code to use ADO instead
of DAO. [3847]
This is a pretty straight forward error message. You cannot run this
kind of code any more.

You may

a) rewrite your code using ADO (the ADODB namespace)
b) use passthrough queries
c) use an older DBEngine instead of the default, e.g.

Dim daoDbEngine36 As Object
Set daoDbEngine36 = CreateObject("DAO.DBEngine.36")
daoDbEngine36.CreateWorkspace(...)



mfG
--> stefan <--
 
P

Pierre Doré

Hi Stefan,

Well I've tried using your 3rd solution with no luck. So now I'm working on
your 1st solution. Here is what I've got so far:

Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim cmd As ADODB.Command

Set cn = New ADODB.Connection
Set cmd = New ADODB.Command
Set rs = New ADODB.Recordset

But I'm stuck. I'm working in the dark. I don't know what needs to be done
next. I've tried surfing the web for ADODB programming, but I can't seem
find what I need to move forward. I need to access an Oracle database and I
don't know which provider that I should be using; OLE DB?

Stefan Hoffmann said:
hi Pierre,
Migrated this MS ACCESS 2002 to 2007 with the .mdb format. Application
starts but when I initiate a command button that runs code to connect to
ORACLE I get the following error message:

ODBCDirect is no longer supported. Rewrite the code to use ADO instead
of DAO. [3847]
This is a pretty straight forward error message. You cannot run this
kind of code any more.

You may

a) rewrite your code using ADO (the ADODB namespace)
b) use passthrough queries
c) use an older DBEngine instead of the default, e.g.

Dim daoDbEngine36 As Object
Set daoDbEngine36 = CreateObject("DAO.DBEngine.36")
daoDbEngine36.CreateWorkspace(...)



mfG
--> stefan <--
 
S

Stefan Hoffmann

hi Pierre,
I need to access an Oracle database and I
don't know which provider that I should be using; OLE DB?
Normally you have the choice between to drivers: the Microsoft OLE DB
Provider for Oracle and an driver from Oracle, depending on the Oracle
version:

http://connectionstrings.com/oracle

If possible, I would use the Oracle driver.

What version of Oracle are you trying to connect to?


mfG
--> stefan <--
 
A

AccessVandal via AccessMonster.com

It may not help you now but it's a start.

http://support.microsoft.com/kb/168336

Try changing the MS one to Oracle.

Conn1.Open "Driver={Oracle ODBC Driver};" & _
"Dbq=YourOracleServerName;" & _
"Uid=*****;" & _
"Pwd=*****"
Migrated this MS ACCESS 2002 to 2007 with the .mdb format. Application
starts but when I initiate a command button that runs code to connect to
ORACLE I get the following error message:
snip
 
P

Pierre Doré

I'm trying to access an Oracle 10i.
I'm also having difficulty with the proper syntax.

Thx for your responses.
Pierre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top