Chapter 6. Using DAO to Access Data

As you've seen in previous chapters, VBA is the programming language you use to programmatically interact with the Access object model. You use VBA to manipulate Access-specific objects, such as forms, reports, and so on. But because Access is a Relational Database Management System, you will undoubtedly find yourself also needing to programmatically interact with the data it contains, and indeed with the database design, or schema. Microsoft Access employs two data access object models: Data Access Objects (DAO) and ActiveX Data Objects (ADO).

Chapter 7 covers ADO; this chapter is solely concerned with the DAO model. It begins with a brief history of DAO and an indication of when it might be most appropriate to use DAO in preference to ADO. You'll see the new features in DAO before examining the three most important objects in the DAO object hierarchy: the DBEngine, Workspace, and Database objects. Then you'll explore database properties and how to use them.

Before you start working with DAO objects to access your data, you'll take an in-depth look at how to use DAO to create and modify your database structure, including tables, fields, indexes, and relations. You'll also spend some time looking at the Access Database Engine (formerly JET or Joint Engine Technology) security model, and how you can create and manipulate security objects, such as users, groups, and of course, how to read and assign object permissions. Finally, you'll look at ...

Get Access™ 2007 VBA Programmer's Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.