Embedding the Recordset Object in the Document Object

In Step 1, AppWizard embedded the CSectionSet object in the document. In this step, you’ll do the same for the second recordset object — an object of the CCourseSet class that you created earlier with ClassWizard.

Suggested Reading in the Visual C++ User’s Guide

To embed the recordset in the document

  1. Click the FileView tab and expand the Enroll files list. Expand the Header Files folder. Double-click file EnrollDoc.h to open it in the text editor.

  2. Declare an embedded CCourseSet object, by adding the following line to the public Attributes section, just beneath the CSectionSet declaration:
    CCourseSet     m_courseSet;
    
  3. Similarly, expand the Source Files folder and open files EnrollDoc.cpp, Enroll.cpp, and SectionForm.cpp, and add an #include directive for “CourseSet.h” before the existing #include directive for “EnrollDoc.h”, as shown in the following line:
    #include "CourseSet.h"
    
  4. Save EnrollDoc.h and the .cpp files.

The document’s m_courseSet member is referred to in the implementation of OnInitialUpdate that you’ll complete later.