AfxDaoTerm
is not closing the database. Quite the contrary it requires that all MFC DAO objects has been
destroyed before calling it. Therefore you must not use instances of DAO objects but allocate them using
new
and delete them before calling
AfxDaoTerm
:
CDaoDatabase *pDb = NULL;
pDb = new CDaoDatabase;
pDb->Open();
if (pDb)
{
if (pDb->IsOpen())
pDb->Close();
delete pDb;
}
AfxDaoTerm();