Creating Relations to linked Tables Via VBA

G

Gerry

I've been using the help file example to try and create a
new relation. but I keep getting an error on the append
that says I can't perform this on Linked tables.
Is there any way to create a relation for linked tables using VBA
If i Can then my next question is can I create
a relation from a local table to a linked table using VBA
I Am using Access2000
Thanks
 
J

John Vinson

I've been using the help file example to try and create a
new relation. but I keep getting an error on the append
that says I can't perform this on Linked tables.
Is there any way to create a relation for linked tables using VBA
If i Can then my next question is can I create
a relation from a local table to a linked table using VBA

You cannot enforce relational integrity across two databases; if you
create a rule in A.MDB there is no way that rule can be enforced if
someone opens X.MDB directly, or by linking to it from B.MDB.
Relationships must be defined in the database which contains the
tables, and only in that database.

You can use the OpenDatabase method to open the backend directly
(rather than using CurrentDb) and use DAO expressions on that database
object.

John W. Vinson[MVP]
 
R

RodABoyd

Hi John,

Can you give me some direction about how I might use a DAO to "uncheck" the
"Enforce Referential Integrity" box between tables in a remote database using
the OpenDatabase method?

Thanks... Rod
 

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