DAO Database Engine Initialization and Termination

DAO is used with Access databases and is supported through Office 2013. DAO 3.6 is the final version, and it is considered obsolete. When using MFC DAO objects, the DAO database engine must first be initialized and then terminated before your application or DLL quits. Two functions, AfxDaoInit and AfxDaoTerm, perform these tasks.

DAO Database Engine Initialization and Termination

Name Description
AfxDaoInit Initializes the DAO database engine.
AfxDaoTerm Terminates the DAO database engine.

AfxDaoInit

This function initializes the DAO database engine.

void AfxDaoInit();

throw(CDaoException*);

Remarks

In most cases, you don't need to call AfxDaoInit because the application automatically calls it when it is needed.

For related information, and for an example of calling AfxDaoInit, see Technical Note 54.

Requirements

Header afxdao.h

AfxDaoTerm

This function terminates the DAO database engine.

void AfxDaoTerm();

Remarks

Typically, you only need to call this function in a regular MFC DLL; an application will automatically call AfxDaoTerm when it is needed.

In regular MFC DLLs, call AfxDaoTerm before the ExitInstance function, but after all MFC DAO objects have been destroyed.

For related information, see Technical Note 54.

Requirements

Header afxdao.h

See also

Macros and Globals