DeleteQueryDef Method Example


This example creates and then deletes a QueryDef.  It also uses the QueryDef to create a Snapshot.


Dim MyDB As Database, MyQuery As QueryDef, ListSet As Snapshot
Set MyDB = OpenDatabase("BIBLIO.MDB")          ' Open a database.
' Create the QueryDef.
Set MyQuery = MyDB.CreateQueryDef("All Pubs", "SELECT * FROM Publishers;")
Set ListSet = MyQuery.CreateSnapshot()         ' Create Snapshot.
MyQuery.Close                                  ' Close QueryDef.
MyDB.DeleteQueryDef("All Pubs")                ' Delete QueryDef.