This documentation is archived and is not being maintained.

DBVLIST Sample: Demonstrates CListView and CDaoRecordset

Visual Studio .NET 2003

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

  1. Open the solution Dbvlist.sln.
  2. On the Build menu, click Build.
  3. 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.

Keywords

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.

See Also

MFC Samples

Show: