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

Chapter 30. Understanding Universal Data... > Creating ADODB.Recordset Objects

Creating ADODB.Recordset Objects

The concept of database object independence is new to Access. The best way of demonstrating this feature is to compare DAO and ADO code to create a Recordset object from an SQL statement. DAO syntax uses successive instantiation of each object in the DAO hierarchy: DBEngine, Workspace, Database, and Recordset, as in the following example:

Dim wsName
						As DAO.Workspace
Dim dbName
						As DAO.Database
Dim rstName
						As DAO.Recordset

Set wsName = DBEngine.Workspaces(0)
Set dbName = wsName.OpenDatabase ("DatabaseName.mdb")
Set rstName = dbName.OpenRecordset ("SQL Statement")


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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