57

Working with DAO

Data Access Objects (DAO) is a set of classes for working directly with the data objects of an Access database, and most commonly, the Table and Query objects of a database. The DAO collection of classes are specific to Microsoft Access and are used directly within the Access Object Model to provide the functionality for working directly with Access data objects. Although DAO provides quite a bit of functionality, this lesson provides a brief overview of using DAO to add, modify, and delete data in an Access database application.

LESSON SETUP

This lesson is designed to provide a basic overview of working with DAO to access data using VBA code. You should be familiar with Access databases, creating modules, and the basics of VBA programming. Also, this lesson uses some strings that are written in the SQL language, so having an understanding of SQL language and how to build SQL statements will aid in better understanding the uses of DAO, though it is not necessarily required. Otherwise, this lesson does not require any other specific knowledge of Access.

THE DAO OBJECT MODEL

The DAO object model contains 15 major object types: DBEngine, Workspace, Database, TableDef, QueryDef, Recordset, Container, Relation, Field, Index, Parameter, Document, User, Group, and Error objects. All of these classes together provide a great deal of functionality for working with many different aspects of an Access database. However, in the interest of sticking to the basics, this lesson ...

Get Microsoft® Access® 2010 24-Hour Trainer now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.