The following procedure describes how to view the new recordset class, CSectionSet
. After examining CSectionSet
, you’ll use the text editor to examine the source files for classes CSectionForm
and CDaoEnrolDoc
.
To examine the new recordset class
Notice the set of classes AppWizard created for you automatically to support the DaoEnrol application.
CSectionSet
.ClassView displays all the member variables that AppWizard created, including a variable for each of the Section table’s columns. You can use ClassWizard to view how AppWizard has bound the Section table’s columns to these member variables.
What you see in this tab corresponds to the variables displayed in ClassView. AppWizard has bound all of the table’s columns to member variables of the CSectionSet
class. These member variables are called “field data members.” AppWizard names the data members automatically, based on the column names from the data source. AppWizard also assigns the correct C++ or class library data type to the data members, based on the column type. In this example, all of the columns are text columns, mapped to type CString, except the Capacity column, which is a short.
CSectionSet
recordset class, click Cancel to exit ClassWizard.The following figure shows the ClassWizard Column Names list.
Table Columns Mapped to Recordset Data Members
If you don’t want all of a table’s columns bound to your recordset, you can delete the recordset field data members for those columns you don’t want by selecting the data member and clicking the Delete Variable button. For the tutorial, you will need them all.
Caution Don’t delete any fields that are part of the table’s primary key (in this case, the SectionNo and CourseID fields).
To change the name of a field data member, delete the member and add it again with the new name.