AppWizard lets you specify whether your database application uses a file as well as a database. The Enroll application doesn’t need a file, so it is based on the Database view without file support option in AppWizard.
Note In order to successfully complete the following procedure, you must have completed the steps required to register the Student Registration database with ODBC. If you have not done so, see Setting Up the Student Registration Data Source, in Lesson 1 of Enroll.
To create the tutorial database application
The New dialog box appears.
Enroll
.AppWizard creates a project directory with the project's name (Enroll) under the directory specified in the Location box.
AppWizard creates the project directory, and the MFC AppWizard – Step 1 dialog box appears.
When you create a database application without file support, AppWizard always creates it as an SDI application.
This enables the Data Source button.
The Database Options dialog box appears.
The Select Database Tables dialog box appears.
This returns you to the MFC AppWizard – Step 2 of 6 dialog box.
Depending on the data source type you are using, additional qualifiers may precede or follow the table name.
In the MFC AppWizard – Step 6 of 6 dialog box, you can check and, if necessary, modify the default names that AppWizard creates for your program’s classes and files.
Note By default, AppWizard bases the names of classes on the project name you supply. This naming is probably fine if your application has only one recordset/view pair. If your application has multiple recordsets and record views, it’s a good idea to change the name of the first recordset/view pair created by AppWizard so the naming better reflects the name of the table in the data source. For Enroll, you’ll modify two class names and their related header and implementation filenames, even though the tutorial uses only one recordset/view pair.
CEnrollSet
, and change it as follows:
In the Class name box, change its name to CSectionSet
.
In the Header file box, change the header filename to SectionSet.h
.
In the Implementation file box, change the name to SectionSet.cpp
.
The base class is CRecordset. The edit item is disabled to show that you can’t change it.
CEnrollView
, and change it as follows:
In the Class name box, change its name to CSectionForm
.
In the Header file box, change the header filename to SectionForm.h
.
In the Implementation file box, change the implementation filename to SectionForm.cpp
.
The base class is CRecordView.
The New Project Information dialog box appears, summarizing the settings and features AppWizard will generate for you when it creates your project.
Take a moment to examine the application type, classes, and features that AppWizard automatically provides.
AppWizard creates all necessary files and opens the project. The next topics describe the AppWizard-createf files in more detail.