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, then the framework uses the bulk record field exchange (Bulk RFX) mechanism to transfer data. For more information, see the article 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. See the article Recordset: Parameterizing a Recordset (ODBC).
- Perform joins (using one recordset for columns from two or more tables). See the article Recordset: Performing a Join (ODBC).
- Bind data columns dynamically. This is less common than parameterization. See the article Recordset: Dynamically Binding Data Columns (ODBC).
If you need a more advanced understanding of RFX, see the article Record Field Exchange: How RFX Works.
The following articles explain the details of using recordset objects:
- Record Field Exchange: Using RFX
- Record Field Exchange: Using the RFX Functions
- Record Field Exchange: How RFX Works