Pages

Friday, November 14, 2008

Sample Code illustrating looping through a DAO recordset





This code is attached to a command button on a form. On the form are the fields txtProgress which displays various messages as well as lblStatus which displays a record count of the progress.



MSDN DAO Recordset: Recordset Operations




DAO Recordset: Recordset Operations

|  Overview |  How Do I |  FAQ |  Sample |  |  ODBC Driver List

This article discusses several key recordset operations, particularly those involving updating records. Topics covered include:

For related information about using recordsets, see the following articles:

Important   Your ability to update records requires that you have update permission for your database and that you have an updatable table-type or dynaset-type recordset. You can't update snapshot-type recordsets with the MFC DAO classes.

Comparison of DAO and ADO Recordset Syntax



How to use these examples

Because they are organized into functional topics and kept very short, none of the examples can stand alone. They won't run unless you combine them. A minimum program would need to use a combination of the "Opening", "Displaying" and "Closing" topics. You can cut and paste the short program topics into a working program. And you can copy and paste the data used in the examples from the table below




Stats