Databases Reference
In-Depth Information
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.
16.1 Recordset Objects
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 Seek method, 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 in the recordset are reflected in the underlying tables or
queries, and changes in the underlying tables or queries, are reflected in the
dynaset-type recordset. With a dynaset-type recordset, no data is brought into
memory. Rather, a unique key is brought into memory to reference each row of
data. Searching through a dynaset-type recordset is done with the Find method,
which is generally slower than the Seek method (which uses one of the table's
indexes).
Snapshot-type Recordset object
A static (nonchangeable) set of records that can contain fields from one or more
tables or queries. These recordsets cannot be updated. For searching, a snapshot-
type recordset can be faster than a dynaset-type recordset.
 
 
Search WWH ::




Custom Search