We recommend using Visual Studio 2017
This documentation is archived and is not being maintained.

DAO Classes

These classes work with the other application framework classes to give easy access to Data Access Object (DAO) databases, which use the same database engine as Microsoft Visual Basic and Microsoft Access. The DAO classes can also access a wide variety of databases for which Open Database Connectivity (ODBC) drivers are available.

Programs that use DAO databases will have at least a CDaoDatabase object and a CDaoRecordset object.


As of Visual C++ .NET, the Visual C++ environment and wizards no longer support DAO (although the DAO classes are included and you can still use them). Microsoft recommends that you use ODBC for new MFC projects. You should only use DAO in maintaining existing applications.


Manages a named, password-protected database session from login to logoff. Most programs use the default workspace.


A connection to a database through which you can operate on the data.


Represents a set of records selected from a data source.


A view that displays database records in controls.


Represents a query definition, usually one saved in a database.


Represents the stored definition of a base table or an attached table.


Represents an exception condition arising from the DAO classes.


Supports the DAO record field exchange (DFX) routines used by the DAO database classes. You will normally not directly use this class.


Encapsulates a handle to storage for a binary large object (BLOB), such as a bitmap. CLongBinary objects are used to manage large data objects stored in database tables.


Wrapper for the OLE automation type CURRENCY, a fixed-point arithmetic type, with 15 digits before the decimal point and 4 digits after.


Wrapper for the OLE automation type DATE. Represents date and time values.


Wrapper for the OLE automation type VARIANT. Data in VARIANTs can be stored in many formats.