Enroll currently has one recordset, for the Section table. This recordset fills the controls on the CSectionForm
record view with information about a single class section of the currently selected course name. Now you will add a second recordset, for the Course table, used to fill the combo box control with a list of all available course names.
To create a new recordset class
This opens the New Class dialog box.
CCourseSet
. This opens the Database Options dialog box.
To connect the recordset class to the Course table
Depending on the database type, you may need to supply additional information to log in to the data source.
The Select Database Tables dialog box opens.
This connects the table name to class CCourseSet
and returns you to the ClassWizard. If necessary, click the Member Variables tab. The Class name box shows CCourseSet
, and three names are listed in the Column Names box.
The table below shows the column names, their data members, and their data types.
Note On the Member Variables tab, you can see that all of the table’s columns are already assigned to field member variable. You can use ClassWizard to delete those variables if you don’t need to access or modify the columns — but be careful not to delete a field member variable for a column that is part of the table’s primary key.
CCourseSet Data Members
Column name | Type | Data member |
CourseID | CString |
|
CourseTitle | CString |
|
Hours | int |
|