deleting relationships with a macro?

J

janaki

I have a macro that will "clean up" my db after appending a bunch of records
from some imported tables.

after getting all the records appended, i want to delete the imported tables.

i've written the macro with "deleteObject" for each of the tables, but when
i run it, i get the error that it can't do it because the tables are linked
by relationships. none of the imported tables are linked to any of the
tables that i want to keep - they're only linked to each other (i.e. all the
linked tables will be deleted). i know that i could import them without the
links, but since i'm having other users do this, i would prefer to not worry
about them skipping the step to not import relationships when they do the
import step.

i hope i've laid the problem out clearly.

any help greatly appreciated!
thanks,
janaki
 
S

Steve Schapel

Janaki,

You didn't mention how you are going about the import of the tables, or
where they are coming from. Presumably you are using a TransferText or
TransferDatabase action in your macro?
 
J

janaki

i'm just manually importing using the "Get external data..." from the File
menu, and selecting "Import..."
 
S

Steve Schapel

Janaki,

Any reason for not using a macro for the import? If you're going to all
the trouble to import manually, why don't you delete the tables manually
afterwards too? Is it feasible to do the manual import of the tables
one by one, rather than all of them in the same step - I think then the
Relationships would not be included.
 
J

janaki

well, i thought about that, but how do i do that?? i can put "RunCommand" in
a macro line, and select "Import", but all that does is trigger the import
function, and i still have to instruct my users to select the correct tables,
and to deselect the relationships checkbox (which, of course, fixes the end
problem).

i suppose i could try coding it, but that's a little over my head!!
 
S

Steve Schapel

Janaki,

Depends where the imported tables are coming from. Probably the
TransferDatabase action in your macro will be applicable.
 

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