Group:  Microsoft Access ยป microsoft.public.access.externaldata
Thread: Use macro's or VBA to write table relationships after import table

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

Use macro's or VBA to write table relationships after import table
MTNCFO 06.06.2006 05:03:01
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
Re: Use macro's or VBA to write table relationships after import table
John Nurick <j.mapSoN.nurick[ at ]dial.pipex.com> 06.06.2006 20:00:31
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.

On Mon, 5 Jun 2006 22:03:01 -0700, MTNCFO
<MTNCFO[ at ]discussions.microsoft.com> wrote:

[Quoted Text]
>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

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.

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