Delete tables

bjackson

Registered User.
Local time
Today, 12:40
Joined
Jan 3, 2003
Messages
404
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
 
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
 

Users who are viewing this thread

Back
Top Bottom