Creating a New Database Application

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.

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

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

  1. From the File menu, choose New.

    The New dialog box appears.

  2. Click the Projects tab.

  3. Complete the Projects dialog box as follows:
  4. Click OK.

    AppWizard creates the project directory, and the MFC AppWizard – Step 1 dialog box appears.

  5. Click the Single document radio button, and then click Next.

  6. In the MFC AppWizard – Step 2 of 6 dialog box:
  7. Click Next to accept the options you have specified, then click Next in the AppWizard dialog boxes for Steps 3, 4, and 5 to accept the default options.

    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.

  8. In the MFC AppWizard – Step 6 of 6 dialog box, make the following changes to class names:
  9. Click Finish.

    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.

  10. Click OK in the New Project Information dialog box.

    AppWizard creates all necessary files and opens the project. The next topics describe the AppWizard-createf files in more detail.