Delete query in another database

N

Nan Hauser

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

Marshall Barton

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top