Connecting Tech Pros Worldwide Forums | Help | Site Map

Linking Access 2003 to Oracle VBA loosing Primary keys

Newbie
 
Join Date: Mar 2007
Posts: 1
#1: Mar 27 '07
I have a series of about 10 test databases with about 34 linked table each. I need to create an Access 2003 database front end for each of these.

I am currently trying to write a script that will allow me to link Access 2003 tables to Oracle tables. The problem is that the Oracle table that I am linking to does not have primary keys. This is a problem because when I write the VBA to link the tables, the linkes tables do not end up with primary keys.

I am trying to write the code to allow me to create the keys with VBA. This is not working. Also, if I try copy a database and use the linked table manager the keys get dropped as well.

Any ideas (with the exception of createing PKs in the Oracel databases?) I want to do this with VBA, I can get it to work fine through the standard UI.



nico5038's Avatar
Moderator
 
Join Date: Nov 2006
Location: The Netherlands
Posts: 2,232
#2: Mar 28 '07

re: Linking Access 2003 to Oracle VBA loosing Primary keys


Hmm, nasty problem. I've never tried to add primary keys to linked tables as the key(s) will be guarded by the original database engine.
Personally I use the File/Get external data/Link tables menu to select all tables from an Oracle database and just keep [Enter] pressed to pass the key definition popup.

You could however try to issue a DDL query with "CREATE INDEX" on such a table to get an additional index, but not sure what the effect will be...

Nic;o)
Reply