Click to open or copy the DAOENROL project files.
DAOENROL is based on the ODBC ENROLL (Step 3) database tutorial. It has been converted to use the Microsoft Foundation Class Library (MFC) DAO classes rather than the MFC ODBC classes.
The sample is functionally equivalent to the ODBC ENROLL sample (Step 3). However, the original ODBC version referenced databases using an ODBC data source name (DSN) and hence did not require a file name. The DAO version, on the other hand, requires the database to be specified as the path to an .mdb file. DAOENROL assumes that the database is called Stdreg32.mdb and is in the same directory as Daoenrol.exe. If this is not the case, you will be prompted to locate the database.
Points of Interest
Converting this sample from the ODBC original was relatively straightforward. The main differences in the two samples are:
This sample demonstrates the following keywords:
AfxMessageBox; CCmdUI::Enable; CComboBox::AddString; CComboBox::DeleteString; CComboBox::FindStringExact; CComboBox::ResetContent; CComboBox::SetCurSel; CDialog::DoModal; CDocument::OnNewDocument; CEdit::SetReadOnly; CFileDialog::DoModal; CFileDialog::GetFileName; CFrameWnd::Create; CFrameWnd::DockControlBar; CFrameWnd::EnableDocking; CFrameWnd::GetActiveView; CFrameWnd::RecalcLayout; CFrameWnd::SetActiveView; CFrameWnd::rectDefault; CObject::AssertValid; CObject::Dump; CObject::GetRuntimeClass; CObject::IsKindOf; CView::GetDocument; CView::OnInitialUpdate; CWinApp::AddDocTemplate; CWinApp::Enable3dControls; CWinApp::InitInstance; CWinApp::LoadStdProfileSettings; CWinApp::OnFileNew; CWnd::Create; CWnd::DoDataExchange; CWnd::GetDlgItem; CWnd::GetWindowText; CWnd::OnCreate; CWnd::SetDlgCtrlID; CWnd::ShowWindow; LoadBitmap