Use macro's or VBA to write table relationships after import table

M

MTNCFO

Hi there

Is there a way to "automate" the writing of realtionships between imported
tables?

I have a situation where I need to re-import tables through an ODBC
connection into access a few times a day, and I need the relationships to be
maintained.

Currently, any macro wirtten to delete and then re-import the tables,
requires all relationships to be deleted first.

Is there a way to 1) delete the existing relatiohsips 2) delete the exiting
tables 3) re-import the updated tables 4) re-create the relationships ??

Thanks in advance for any advice you may be able to offer.

MTN
 
J

John Nurick

Instead of deleting and re-importing the tables, use delete queries to
delete the *records* they contain. Then import the updated data into the
existing tables. Assuming that the relationships enforce relational
integrity, you'll need to be careful about the order in which you run
the queries and import the data.

But would it not be simpler to use linked tables to access the ODBC
datasource? That way, you'd always have the latest data and there'd be
no need to delete and re-import stuff.
 

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