Data Access Objects (DAO) Tutorial

DAOEnrol: Database Application, Lesson 1

Tip   If you prefer working from a printed tutorial, see in MSDN Library Help for details about printing a lesson, a set of topics, or a single topic.

The DaoEnrol tutorial shows you how to develop an MFC database application using the Data Access Objects (DAO) database classes. This tutorial uses similar procedures and creates nearly the same application as the Enroll tutorial.

In the DaoEnrol tutorial, you’ll learn how to:

This lesson contains:

There are some differences in the code generated for DaoEnrol and the code generated for Enroll. Consequently there are separate instructions for some topics of DaoEnrol that need to be substituted for topics in Lessons 3 and 4. These topics are included at the end of this lesson in DaoEnrol Step 2 and DaoEnrol Step 3.

Note   The sample reflects the completed DaoEnrol tutorial, plus an undocumented fourth step. Separate source code is not provided for each of the DaoEnrol tutorial steps either under Samples \ MFC Samples in the online documentation or on the Visual C++ distribution CD.

Important   This tutorial assumes you are familiar with Visual C++ and MFC. If you aren’t, try the Scribble tutorial before you begin this tutorial. The Scribble tutorial introduces important class library concepts and techniques and teaches you to use the wizards and the resource editors.

It is not necessary to complete Enroll, the ODBC database classes tutorial, before starting DaoEnrol.

DaoEnrol and Enroll

DAO recordset, database, and record view class implementations are very similar to that of the ODBC database classes. This means that skills and knowledge you may already have as a result of using the ODBC database classes can apply to the DAO database classes. By completing both the Enroll and DaoEnrol tutorials, you have the opportunity to compare the code and study both implementations. You can also use DaoEnrol as a basis for an application that uses more of MFC’s DAO functionality.

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