Linking of ORACLE-ODBC-Tables to Access-MDB by VBA-Code fails...

M

Mike Jo

Dear Developers,

My Access-application with ORACLE-8-Database as backend worked since years
without problems. At evry
launch of the MDE it checked the selected ODBC-source and relinked all
needed tables from that source by VBA-Code like:

Dim td As TableDef
set db = CurrentDB
sTable = "OracleTableName"
sConnect =
"ODBC;DSN=MyDSN;UID=MyUser;DBQ=MyService;DBA=W;APA=T;EXC=T;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;FRL=F;BAM=IfAllSuccessful;MTS=T;CSR=F;FWC=F;PFC=10;TLO=0;;"
Set td = db.CreateTableDef(sTable, 0, sTable, sConnect)
db.TableDefs.Append td

This way it always worked well.
But my customers now move to ORACLE 9i. The architecture of the database
didn´t change at all. It is actually possible to link the tables of the new
ODBC-source MANUALLY (!) by using the Access-menu "File" - "External Data" -
Link Tables ... ODBC .... Select Table .... OK. Works! The table is linked
and everything is fine.
But doing so by using the good old VBA-Code above I now get the
error-message (translated into english):
"Error linking table 'OracleTableName', Connection 'ODBC;DSN=.....'. The
Microsoft Jet-Database-Engine didn´t find the object 'OracleTableName'. Make
sure, that the object exists.... bla bla..."
There´s no way anymore to create the linked table by the existing code. It
is the same schema as before, the same user-rights as before and so on. And
this problem appears with more than one customer, so it isn´t a
single-customer-problem...
All of the customers use Windows 2003 Server, MS Access 2002 (XP) full
version.

How can I move Access to create the linked tables the same way as it works
manually???
(I think the additional switches within the Connect-String are not really
relevant, are they?)

Any help appreciated! Thanks!

CU
Mike
 

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