Chapter 16. Programming DAO: Data Manipulation Language
In Chapter 15 we examined how to use DAO to create and access the major components of a database, like its tables, its indexes, or its query definitions. For the most part, though, the focus of a database application is on accessing and manipulating discrete items of data stored in one or more records. In this chapter, we’ll continue our overview of Data Access Objects by examining its data manipulation component, which allows you to perform such practical maintenance operations as adding, deleting, and updating records and accessing the records that your application is to display.
The main tool for manipulating data is the Recordset object. There are three types of Recordset objects:
- Table-type Recordset object
A representation of the records in a single table of the database. It is like a window into the table. Thus, operations on this type of recordset directly affect the table. I emphasize that a table-type recordset can be opened for a single table only. It cannot be opened for a join of more than one table or for a query. A table-type recordset can be indexed using a table index. This provides for quick manuvering within the table, using the
Seekmethod, which we will discuss later in the chapter.
- Dynaset-type Recordset object
A dynamic (changeable) set of records that can contain fields from one or more tables or queries. Dynaset-type recordsets are generally updatable in both directions. Thus, changes ...