The tutorial consists of three steps. The following table describes the steps briefly.
Tutorial step | Description |
1 | Use AppWizard to create an application with database support. The document embeds a CRecordset object for the Section table of the Student Registration data source. Use the dialog editor to design the form. Use ClassWizard to bind controls on the form to fields in the recordset. |
2 | Provide a combo box control on the form so the user can select a course and view its sections. Fill the combo box from a recordset object representing the Course table. Filter and parameterize the recordset to constrain the records it selects. |
3 | Implement a user interface for adding, updating, and deleting records. Handle database exceptions. |
The ENROLL sample program directory contains a subdirectory for each step of the tutorial, named STEP1, STEP2, and STEP3. Each step’s subdirectory contains complete source files, and other files needed for the step.
If you do not have local copies of the Sample files, you can easily install them. For more information, see Installing the Sample Files in Scribble, Lesson 1. While you don’t need to have a copy of these files locally in order to develop the project yourself, you might find it useful, for example to compare source code.
The sample source code for ENROLL includes a fourth step, not covered in the tutorial. Step 4 illustrates additional class library database programming techniques, summarized below. See ENROLL in Visual C++ Samples \ MFC Samples \Tutorial Samples for a discussion of Enroll Step 4. The main techniques illustrated by Enroll Step 4 are: