Setting Up the Student Registration Data Source for DaoEnrol

Before you begin the DaoEnrol tutorial you must specify a database. You can either:

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

MFC support for Data Access Objects (DAO) does not rely on Open Database Connectivity (ODBC) for most database formats. Because of the flexibility of the DAO database classes, you have several options for creating and using the DaoEnrol database:

  • Microsoft Access (.MDB)   While you can create a database, tables, queries, fields, indexes, and recordsets with DAO, it is much easier to just use the StdReg32.mdb database supplied with Visual C++ for this tutorial. See the procedure To use StdReg32.mdb with DaoEnrol, in the next topic.

  • ISAM databases   The Microsoft Jet database engine works natively with Microsoft Access .MDB files, but it can also directly read  Indexed Sequential Access Method (ISAM) databases such as Paradox, dBase, and FoxPro. For better performance, attach these external data sources as tables in a Microsoft Access .MDB file. For this tutorial, the tables must match the Student Registration database schema. See the procedure To create your own database for DaoEnrol.

  • Other database formats   If you want to use a database format other than one read by the Microsoft Jet database engine, you must install the corresponding 32-bit ODBC driver, as well as its related database management system (DBMS). Microsoft Visual C++ ships 32-bit ODBC drivers for most standard database formats. Use the DBMS to add tables to your database so that it matches the Student Registration database schema. See the procedure To create your own database for DaoEnrol.

Note   When you use AppWizard to create a DAO database application, the only database type offered as a selection is a Microsoft Access .MDB file. This tutorial assumes that you will use the StdReg32.mdb file. If you use another database type, you must use Microsoft Access to create an .MDB file, attach the database table to that .MDB file, and select that .MDB file during the selection of the Data Source in MFC AppWizard â€“ Step 2 of 6.