Group:  Microsoft Access » microsoft.public.access.odbcclientsvr
Thread: Linking of ORACLE-ODBC-Tables to Access-MDB by VBA-Code fails...

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Linking of ORACLE-ODBC-Tables to Access-MDB by VBA-Code fails...
"Mike Jo" <joker-soft[ at ]gmx.net> 18.12.2005 21:31:34
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


Re: Linking of ORACLE-ODBC-Tables to Access-MDB by VBA-Code fails...
Stefan Hoffmann <stefan.hoffmann[ at ]explido.de> 19.12.2005 09:38:13
hi Mike,

Mike Jo wrote:
[Quoted Text]
> sTable = "OracleTableName"
Include the schema prefix.

> 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;;"
Try "ODBC;DSN=YourDSN;UID=YourUser;". The other parameters should be
obsolete for linking the tables.


mfG
--> stefan <--

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net