Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table existance.

Status
Not open for further replies.

Peps

Programmer
Feb 11, 2001
140
ES
Could any one suggest me how to check whether a table exists before running a macro? This question was asked by Charlie in thread 181-6951. My question is: Is it possible to check the existence of a table without trying to open it first? What I need to do is delete a table (only if it exists), If however the table does not exist you get the typical "Action failed" error box before the code can complete it's loop.

Anyone got any ideas
Peps
 
If memory serves me correctly, in the thread you mention, the bottom of that code has the error handling to trap that error so that the code can continue... Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
Your right, but what I'd like to know: Is it possible to get the error code 7874 without opening the table first?. What I don’t want to do is Open the table, close the table and then delete. Your code does work, however I have to follow this procedure.

Thanks
Peps


 
I thought that I heard that there is a System table that lists all the objects in the database, but I don't know much about it. You might try doing a keyword search for it here, as I know I have seen posts of it here. Terry M. Hoey
th3856@txmail.sbc.com
While I don't mind e-mail messages, please post all questions in these forums for the benefit of all members.
 
make a subroutine

on local error resume next
db.execute "DROP TABLE thing"

and call the subroutine. You don't need to check whether it is there, as the sub will ignore the error.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top