Delete query in another database

  • Thread starter Thread starter Nan Hauser
  • Start date Start date
N

Nan Hauser

Is there any way to delete a query in another database other than the current
database?
 
Nan said:
Is there any way to delete a query in another database other than the current
database?


That does not sound like a good approach to whatever you are
trying to accomplish.

For a Jet database, you can use code something like:

Dim db As DAO.Database
Dim qdf As DAO.Query
Set db = OpenDatabase("full path to other database")
db.QueryDefs.Delete "name of table"
db.Close : set db = Nothing

But there are nuances so be sure to check VBA Help on the
OpenDatabase method and QueryDefs collection.
 
Back
Top