condition on DeleteObject action in macro

L

lynn

Hi,

I need to delete a table and then re-import it ... How do
I run the deleteobject action only if the table exists?
 
S

Steve Schapel

Lynn,

You can't check for the existence of an object with a macro. The best
way around this, as far as I know, is to create a Make-Table Query to
make a table with the name of the table you want to delete, and use an
OpenQuery action to run this Make-Table before the DeleteObject action.
If the table didn't exist, it will now. If it did exist, the
Make-Table will overwrite it, which doesn't matter because you are
trashing it anyway. Either way, the DeleteObject will proceed without
an error.
 

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