Creating a New DAO Database Application

When you use AppWizard to create a DAO database application, the only database type offered as a selection is the Microsoft Access .MDB database. Using either Access data in an .MDB file or an installable ISAM database as an attached table to an .MDB file gives your application the best performance for data retrieval and manipulation. The procedures in this tutorial assume that you are using the StdReg32.mdb file supplied on the Visual C++ distribution CD.

Suggested Reading

AppWizard lets you specify whether your database application uses a file as well as a database. The DaoEnrol application does not need a file, so it is based on the Database view without file support option in AppWizard.

Note   The following procedure describes how to enter the correct values in the AppWizard Steps to create the DaoEnrol application. Many of the Steps contain choices that you will not use to create the starter files for DaoEnrol.

To create the tutorial database application

  1. From the File menu, click New.

    The New dialog box appears.

  2. Click the Projects tab.

  3. Fill in or select the remaining boxes 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 proceed to the rest of the AppWizard Steps.

  8. Click Next in AppWizard 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/record view pair. If your application has multiple recordsets and record views, it’s a good idea to change the name of the first recordset/record view pair created by AppWizard so the naming better reflects the name of the table in the data source. For DaoEnrol, you’ll modify two class names and their related header and implementation filenames, even though the tutorial uses only one recordset/record view pair.

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

    The New Project Information dialog box appears, summarizing the settings and features AppWizard will generate for you when it creates your project.

    You might want to take a moment to examine the application type, classes, and features that AppWizard automatically provides.

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

    AppWizard creates all necessary files and opens the project.

Use ClassView to view the classes that AppWizard just created.