Record Field Exchange Functions


The new home for Visual Studio documentation is Visual Studio 2017 Documentation on

The latest version of this topic can be found at Record Field Exchange Functions.

This topic lists the Record Field Exchange (RFX, Bulk RFX, and DFX) functions used to automate the transfer of data between a recordset object and its data source and to perform other operations on the data.

If you are using the ODBC-based classes and you have implemented bulk row fetching, you must manually override the DoBulkFieldExchange member function of CRecordset by calling the Bulk RFX functions for each data member corresponding to a data source column.

If you have not implemented bulk row fetching in the ODBC-based classes, or if you are using the DAO-based classes, then ClassWizard will override the DoFieldExchange member function of CRecordset or CDaoRecordset by calling the RFX functions (for ODBC classes) or the DFX functions (for DAO classes) for each field data member in your recordset.

The record field exchange functions transfer data each time the framework calls DoFieldExchange or DoBulkFieldExchange. Each function transfers a specific data type.

For more information about how these functions are used, see the articles Record Field Exchange: How RFX Works (ODBC). For more information about bulk row fetching, see the article Recordset: Fetching Records in Bulk (ODBC).

For columns of data that you bind dynamically, you can also call the RFX or DFX functions yourself, as explained in the articles Recordset: Dynamically Binding Data Columns (ODBC). Additionally, you can write your own custom RFX or DFX routines, as explained in Technical Note 43 (for ODBC) and Technical Note 53 (for DAO).

For an example of RFX and Bulk RFX functions as they appear in the DoFieldExchange and DoBulkFieldExchange functions, see RFX_Text and RFX_Text_Bulk. DFX functions are very similar to the RFX functions.

RFX Functions (ODBC)

RFX_BinaryTransfers arrays of bytes of type CByteArray.
RFX_BoolTransfers Boolean data.
RFX_ByteTransfers a single byte of data.
RFX_DateTransfers time and date data using CTime or TIMESTAMP_STRUCT.
RFX_DoubleTransfers double-precision float data.
RFX_IntTransfers integer data.
RFX_LongTransfers long integer data.
RFX_LongBinaryTransfers binary large object (BLOB) data with an object of the CLongBinary class.
RFX_SingleTransfers float data.
RFX_TextTransfers string data.

Bulk RFX Functions (ODBC)

RFX_Binary_BulkTransfers arrays of byte data.
RFX_Bool_BulkTransfers arrays of Boolean data.
RFX_Byte_BulkTransfers arrays of single bytes.
RFX_Date_BulkTransfers arrays of data of type TIMESTAMP_STRUCT.
RFX_Double_BulkTransfers arrays of double-precision, floating-point data.
RFX_Int_BulkTransfers arrays of integer data.
RFX_Long_BulkTransfers arrays of long integer data.
RFX_Single_BulkTransfers arrays of floating-point data.
RFX_Text_BulkTransfers arrays of data of type LPSTR.

DFX Functions (DAO)

DFX_BinaryTransfers arrays of bytes of type CByteArray.
DFX_BoolTransfers Boolean data.
DFX_ByteTransfers a single byte of data.
DFX_CurrencyTransfers currency data, of type COleCurrency.
DFX_DateTimeTransfers time and date data, of type COleDateTime.
DFX_DoubleTransfers double-precision float data.
DFX_LongTransfers long integer data.
DFX_LongBinaryTransfers binary large object (BLOB) data with an object of the CLongBinary class. For DAO, it is recommended that you use DFX_Binary instead.
DFX_ShortTransfers short integer data.
DFX_SingleTransfers float data.
DFX_TextTransfers string data.

Macros and Globals