The following table shows what you typically must do to work with a record view and what the framework does for you.
You | The framework |
---|---|
Use the Visual C++ Dialog editor to design the form. |
Creates a dialog template resource with controls. |
Use the |
Writes the classes for you. |
Map record view controls to recordset field data members. |
Provides DDX between the controls and the recordset fields. |
В |
Provides default command handlers for Move First, Move Last, Move Next, and Move Previous commands from menus or toolbar buttons. |
В |
Updates changes to the data source. |
[Optional] Write code to fill list boxes or combo boxes or other controls with data from a second recordset. |
В |
[Optional] Write code for any special validations. |
В |
[Optional] Write code to add or delete records. |
В |
Form-based programming is only one approach to working with a database. For information about applications using some other user interface, or no user interface, see MFC: Using Database Classes with Documents and Views and MFC: Using Database Classes Without Documents and Views. For alternative approaches to displaying database records, see classes