• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

15. Programming DAO: Data Definition Language > 15.6. Creating a QueryDef

Creating a QueryDef

Creating a QueryDef object is done using the CreateQueryDef method. The syntax is:

SetQueryDefVar = DatabaseVar.CreateQueryDef _
([QueryDefName][, SQLText])

where QueryDefName is the name of the new QueryDef object and SQLText is a string expression that constitutes a valid Access SQL statement.

Notes

  • If you include QueryDefName, the QueryDef is automatically saved (appended to the appropriate QueryDefs collection) when it is created. The Name property and the SQL property of a QueryDef can be changed at any time.

  • You can create a temporary QueryDef, which is not appended to a collection, by setting the QueryDefName property to a zero-length string (“”). You cannot change the name of a temporary QueryDef.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint