Embedding the Recordset Object in the Document Object in DaoEnrol

In DaoEnrol 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. From FileView, open the Header Files folder and double-click the file DenrlDoc.h to open it.

  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 DenrlDoc.cpp, Daoenrol.cpp, and SectForm.cpp, and add a #include directive for “CourseSe.h” before the existing #include directive for “DenrlDoc.h”, as shown in the following line:
    #include "CourseSe.h"
    
  4. Save DenrlDoc.h and the .cpp files.

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