Chapter 1: Data Access Models: Part I
Overview
Microsoft Access 2003 supports two data access models: the traditional Data Access Objects (DAO) and ActiveX Data Objects (ADO). ADO is part of the Microsoft Data Access Components (MDAC), which initially targeted universal data access. DAO targets just the Jet database engine. DAO was the exclusive data access model for Access developers from Access 1.0 through Access 97. Therefore, it is finely tuned to the Jet database engine. This feature is both a strength and a weakness. While DAO can still perform a few selected tasks for the Jet engine that are impossible or very difficult to do with ADO, accessing data from sources other than Jet using DAO can be very awkward or impossible, depending on the context.
Access 2000 was the first Access version to support ADO for data access to Jet as well as to other databases. ADO is a separate technology from Microsoft Access, but Access interoperates well with it. With Access 2002 and Access 2003, Microsoft improved on past functionality and added new capabilities to ADO programming. Instead of being based on a single database engine (such as DAO), ADO uses a common programming model to access data universally. It relies on OLE DB providers for low-level links to data sources. OLE DB technologies eventually will make their ODBC predecessors obsolete, much as ADO will replace DAO. In fact, the MDAC Road Map (Chapter 2 focus primarily on data access for Jet with the ADO object model. The two chapters also include some coverage of ADO with other database engines, particularly with Microsoft SQL Server. Numerous programming samples show you how to accomplish typical database chores.This chapter begins with an overview of ActiveX Data Objects and then moves on to discuss the Connection, Recordset, and Field objects. This chapter aims to convey a basic understanding of the kinds of roles each object plays, as well as how to code the objects. In Chapter 2, you will learn about the Command and Parameters objects and the Errors collection. Chapter 2 also devotes considerable attention to demonstrating the features of the ADO Record and Stream objects. Chapter 2 closes with a review of ADO event programming techniques. Later chapters build on the information presented in Chapter 1 and Chapter 2 and cover advanced data topics, such as database replication, remote database access, and multiuser security.