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

Chapter 27. Understanding the Data Acces... > Creating New Data Access Objects

Creating New Data Access Objects

As mentioned in the section Creating Object Variables earlier in this chapter, Access 97 lets you create new DAOs with Access VBA code. The most common DAOs you create with Access VBA are Recordset and QueryDef objects. QueryDef objects, like TableDef objects, are called persistent objects because QueryDef and TableDef objects also are Document objects: Query and Table objects, respectively. QueryDef and TableDef objects are stored as elements of your .mdb file and appear in the Queries and Tables lists, respectively, of the Database window. Recordset objects are impersistent objects; they exist in memory only from the time you open them until they are closed. You can close a Recordset object by applying the Close method; Recordset objects are closed automatically when the variable that points to them goes out of scope. When you close a Recordset object, the memory that the object consumes is released to your application.

Note

Using Access VBA to create new Workspace, Database, User, Group, TableDef, and Relation objects is beyond the scope of this book. You can create these objects, with the exception of the Workspace object, much easier with Access's user interface. You also can create new TableDef objects with make-table queries or by using Jet SQL Data Definition Language statements.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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