Record Field Exchange (RFX)
The MFC ODBC database classes automate moving data between the data source and a recordset object. When you derive a class from CRecordset and do not use bulk row fetching, data is transferred by the record field exchange (RFX) mechanism.
Note
If you have implemented bulk row fetching in a derived CRecordset
class, the framework uses the bulk record field exchange (Bulk RFX) mechanism to transfer data. For more information, see Recordset: Fetching Records in Bulk (ODBC).
RFX is similar to dialog data exchange (DDX). Moving data between a data source and the field data members of a recordset requires multiple calls to the recordset's DoFieldExchange function and considerable interaction between the framework and ODBC. The RFX mechanism is type-safe and saves you the work of calling ODBC functions such as ::SQLBindCol
. For more information about DDX, see Dialog Data Exchange and Validation.
RFX is mostly transparent to you. If you declare your recordset classes with the MFC Application Wizard or Add Class (as described in Adding an MFC ODBC Consumer), RFX is built into them automatically. Your recordset class must be derived from the base class CRecordset
supplied by the framework. The MFC Application Wizard lets you create an initial recordset class. Add Class lets you add other recordset classes as you need them. For more information and examples, see Adding an MFC ODBC Consumer.
You must manually add a small amount of RFX code in three cases, when you want to:
Use parameterized queries. For more information, see Recordset: Parameterizing a Recordset (ODBC).
Perform joins (using one recordset for columns from two or more tables). For more information, see Recordset: Performing a Join (ODBC).
Bind data columns dynamically. This is less common than parameterization. For more information, see Recordset: Dynamically Binding Data Columns (ODBC).
If you need a more advanced understanding of RFX, see Record Field Exchange: How RFX Works.
The following topics explain the details of using recordset objects:
See also
Open Database Connectivity (ODBC)
Recordset (ODBC)
MFC ODBC Consume
Database Support, MFC Application Wizard
CRecordset Class