Record Field Exchange (RFX)
| Overview | How Do I | FAQ | Sample | | ODBC Driver List
The MFC ODBC database classes automate moving data between the data source and a recordset object. When you derive a class from and do not use bulk row fetching, data is transferred via 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 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 AppWizard or ClassWizard, RFX is built into them automatically. Your recordset class must be derived from the base class CRecordset supplied by the framework. AppWizard lets you create an initial recordset class. ClassWizard lets you add other recordset classes as you need them. You use ClassWizard to map recordset field data members to table columns on the data source. For more information and examples, see the article ClassWizard: Creating a Recordset Class.
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:
See Also Recordset (ODBC), ClassWizard: Creating a Recordset Class, Overview: Creating a Program That Supports a Database,