Home | Overview | How Do I | FAQ | Sample | Tutorial | ODBC Driver List
This article explains how to use the RFX function calls that make up the body of your DoFieldExchange override.
Note This article applies to classes derived from CRecordset in which bulk row fetching has not been implemented. If you are using bulk row fetching, then bulk record field exchange (Bulk RFX) is implemented. Bulk RFX is similar to RFX. To understand the differences, see the article Recordset: Fetching Records in Bulk (ODBC).
The RFX global functions exchange data between columns on the data source and field data members in your recordset. Normally you use ClassWizard to write the RFX function calls in your recordset’s DoFieldExchange member function. This article describes the functions briefly and shows the data types for which RFX functions are available. Technical Note 43 describes how to write your own RFX functions for additional data types.
Each RFX function takes three parameters (and some take an optional fourth or fifth parameter):
For more information, see the RFX functions under Macros and Globals in the Class Library Reference. For an example of when you might make special use of the parameters, see the article Recordset: Obtaining SUMs and Other Aggregate Results (ODBC).
The class library supplies RFX functions for transferring many different data types between the data source and your recordsets. The following list summarizes the RFX functions by data type. In cases where you must write your own RFX function calls, select from these functions by data type.
Function | Data Type |
RFX_Bool | BOOL |
RFX_Byte | BYTE |
RFX_Binary | CByteArray |
RFX_Double | double |
RFX_Single | float |
RFX_Int | int |
RFX_Long | long |
RFX_LongBinary | CLongBinary |
RFX_Text | CString |
RFX_Date | CTime |
For more information, see the RFX function documentation under Macros and Globals in the Class Library Reference. For information about how C++ data types map to SQL data types, see the table ANSI SQL Data Types Mapped to C++ Data Types in the article SQL: SQL and C++ Data Types (ODBC).
See Also Record Field Exchange: How RFX Works, Recordset: Parameterizing a Recordset (ODBC), Recordset: Dynamically Binding Data Columns (ODBC), CRecordset, CFieldExchange