DBVLIST Sample: Demonstrates CListView and CDaoRecordset
The DBVLIST sample uses MFC's CListView and CDaoRecordset classes to implement the virtual list view functionality that is available for the list view common control.
The sample demonstrates how virtual list views can be used to display very large lists of items as well as items that may not all be in memory at once. It displays a list of database items (employee records) filtered by division that is selectable by the user at run time.
Building and Running the Sample
To build and run the DBVLIST sample
- Open the solution Dbvlist.sln.
- On the Build menu, click Build.
- On the Debug menu, click Start Without Debugging.
Initially, DBVLIST comes up blank. Select the division you want to view with the combo box in the upper pane, and then click the Fetch Results button. The results will appear in the list view in the pane in the lower half of the window. You can also change the sort order of the list by clicking the column header of the item you want to sort.
This sample demonstrates the following keywords:
CDaoRecordset::IsOpen; CDaoRecordset::Open; CDaoRecordset::Requery; CDaoRecordset::IsEOF; CDaoRecordset::MoveNext; CDaoRecordset::MoveFirst; CDaoRecordset::GetRecordCount; CListView::GetListCtrl; CListCtrl::InsertColumn; CListView::OnChildNotify
Note Some samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task.