Note Before starting this topic, you should have already completed the following instructions in the Enroll tutorial, Lesson 3:
DaoEnrol already has one recordset, for the Section table, which fills the controls on the CSectionForm
record view with information about a single class section of the currently selected course name. Now you’ll 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
This displays the Open dialog box.
The Select Database Tables dialog box opens.
This connects the table name to class CCourseSet
and returns you to the ClassWizard 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 variables. 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 | short |
|