If you want to display OLE DB rowset data in an MFC application, you should use the MFC class
В | Copy Code |
---|---|
COleDBRecordView myRecordView; ... // CProductAccessor is a user record class CRowset<CAccessor<CProductAccessor>> myRowSet = myRecordView.OnGetRowset(); |
The view displays the fields of the CRowset object in the dialog's controls. The COleDBRecordView object uses Dialog Data Exchange (DDX) and the navigational functionality built into CRowset (MoveFirst, MoveNext, MovePrev, and MoveLast) to automate the movement of data between the controls on the form and the fields of the rowset. COleDBRecordView keeps track of the user's position in the rowset so that the record view can update the user interface and supplies an
You can use DDX functions with COleDbRecordView to get data directly from the database recordset and display it in a dialog control. You should use the DDX_* methods (such as DDX_Text), not the DDX_Field* functions (such as DDX_FieldText) with COleDbRecordView.