Relinking database with code

M

Mike San Filippo

How can I write a module to relink a database with code?

I have a database that I just want to click on a button
and it will relink to something like c:\db\db_be.mdb

And you click another button to relink it to live data. or
even just doubleclick on a module or macro. either or.

Also, sometimes when I write databases I integrate other
db's also. I want to be able to relink multiple databases
w/ code too.

Any ideas?

Thanks,
Mike
 
A

Allen Browne

Loop through the TableDefs.
If it's not a system table (starts with MSys) or a temporary/deleted table
(starts with ~), and it has something in its Connect property, then it is a
linked table.

Set the Connect property to the correct string, and RefreshLink.

For multiple back-ends, you will need some way to indicate which file to
attach to, e.g. your own table of what links to which.
 

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