View Full Version : Delete tables


bjackson
03-31-2005, 09:11 PM
Is it possible to delete a table from a remote access db.
i.e
table "A" is in database "A"

from a form in database "B" i would like to run a routine that would
Delete table "A" from database "A"

i have tried using "DoCmd.DeleteObject acTable" but i think this only works for the currentdb
Can anybody help

Regards
Bjackson

I am using A2K

bjackson
04-01-2005, 01:50 AM
After searching the web i found this

Dim db As DAO.Database
Set db = DBEngine.Workspaces(0).OpenDatabase("DbNameHere", , False)
db.TableDefs.Delete "TableNameHere"
db.TableDefs.Refresh
db.Close
Set db = Nothing

It seems to do the job