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

Delete a table in Access 1

Status
Not open for further replies.

Cloonalt

Programmer
Jan 4, 2003
354
US
I run a SQL job to send data from SQL to an Access database every night. However it doesn't work if the table is already in the Access database.

When I start the Access app, I check for the existence of the table and do what I need to do with it.

After that I want to delete the table from the Access database. Can't find the syntax.

Can someone point me to it? Any help is appreciated.
 
Code:
DoCmd.DeleteObject()

CMP

Funny thing about being unemployed, weekends don't mean quite so much, just means you get to hang out with your working friends. Primus
 
DoCmd.DeleteObject acTable, "tablename"

Thanks
 
Note that DeleteObject requires you to have exclusive access to the db when running the deletion, at least in later versions of Access.

An SQL alternative uses the DROP TABLE command...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top