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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check to see if table Exists 1

Status
Not open for further replies.

DseeDm

Programmer
Sep 2, 2002
31
US
Hello,

I'm using Access97 and wondering whats the quickest way to determine if a table exists. I want to delete the table if it exists. Currently, I loop through Tabledefs and I delete the table if found. The more tables I have, the longer this takes...

Any Ideas?

Thanks
DCD
 
And what about something like this ?
On Error Resume Next
DoCmd.RunSQL "DROP TABLE [" & strTableName & "];"
On Error GoTo yourErrorHandler

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top