This problem occurs only if a dialog resource is loaded. This includes
applications that use CFormView-derived classes, such as CRecordView
and CDaoRecordView, as well as dialog-based applications.
The following sample code shows the workaround for a default MFC
AppWizard application using the MFC DAO classes. The call to LoadLibrary()
is added to the Open() function of the CDaoRecordset-derived class named
CMySet. Similar logic can be used for the MFC ODBC classes.
To fix the DAOEnrol sample, add the LoadLibrary() call in the sample code
below to the CDaoEnrolDoc::OnNewDocument() function, before the call to
the base class CDocument::OnNewDocument() function.
To fix the Enroll tutorial, add the LoadLibrary() call in the sample code
below to the CEnrollDoc::GetDatabase() function, after the call to
m_database.Open().
Sample Code
void CMySet::Open(int nOpenType, LPCTSTR lpszSql, int nOptions)
{
CDaoRecordset::Open(nOpenType, lpszSql, nOptions);
// Load the Jet Engine to ensure that it remains in memory
// during the shutdown process.
LoadLibrary( "MSJT3032.DLL" );
}