Click to open or copy the ComplexDB project files.
This sample uses the OLE DB consumer template classes to create an ATL control that uses complex data binding to show data in a list box. A complex data-bound control uses the OLE DB data-binding interfaces (IDataSource and IRowPosition) to gain access to a rowset (see Creating a Complex Control).
To build the sample, make sure that the ActiveX Control Writer's SDK for OLE DB is installed and that you have added the relevant include and lib directories to your paths.
Once built, you can test the control by performing the following steps, or by building and running the MFCBind project that is part of this sample:
ConnectionString = DSN=OLE_DB_NWind_Jet
RecordSource = select * from products
The value of the specified field for each record in the query should be displayed in the list box. You can also use the controls on the ADO data control to move forward and backward through the records.