Understanding Recordsets and Record Views

A recordset object represents a set of records selected from a data source. A recordset may represent a selection of one or more specified columns from rows of one or more database tables.

A CRecordset object represents both the recordset's selection of records and the actual field values for one currently selected record.

A record view is a specialized view class that uses controls laid out in a dialog template resource to view and/or edit the fields of a recordset in a dialog-like form. A CRecordView object is associated with both a recordset object and a dialog template resource. The dialog template resource has an ID of the form IDD_XXX_FORM, where XXX is based on the project name.

CRecordView derives its form behavior from class CFormView. CRecordView supports end-user navigation through records, one at a time, using Move First, Move Next, Move Previous, and Move Last commands of the associated CRecordset object. When you update the value in a control on the form and navigate to another record, the corresponding recordset field is automatically updated.

In the next topic, you will create a new database application using AppWizard. While in AppWizard, you identify an Open Database Connectivity (ODBC) data source and a table in the data source. AppWizard creates a pair of classes: a recordset class and a record view class.