SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 69 | Next

Jim DeMarco

"Pro Excel 2007 VBA"


In Office 2000, Microsoft made ADO the default data access method, which caused programmers
who used DAO heavily to learn to use explicit references to their data access model.
You can use DAO to access SQL data via ODBC, and Microsoft Access data via Jet. Jet is
no longer a part of the Microsoft Data Access Components (MDAC) with the 2007 release.
Office 2007 introduces a new version of the Jet engine called ACE (Access Engine).
The DAO object model is shown in Figure 2-11, and its common objects are described
in Table 2-3, which follows.
Figure 2-11. DAO Jet object model
CHAPTER 2 n DATA IN, DATA OUT 54
Table 2-3. Common DAO Objects
Object Description
DBEngine The top-level object in the DAO object hierarchy
Workspace An active DAO session
Connection The network connection to an ODBC database
Database An open database
Error Data access error information
Field A field in a database object
TableDef Saved table information in a database
QueryDef Saved query information in a database
Recordset A set of records defined by a table or query
Index Table index
User A user account in the current workgroup
Parameter Query parameter
Property Property of an object
Let??™s take a look at how easy DAO is to use by bringing data from the Northwind 2007
database into an Excel worksheet using DAO.
DAO Example 1: Importing Access Data Using Jet
Open a new workbook and name it DataAccessSample03.xlsm. Be sure to use the .xlsm extension
so your workbook is macro-enabled.


Pages:
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81