Share via


DAO Record Field Exchange: Using DFX

OverviewHow Do IFAQSampleODBC Driver List

This article explains what you do to use DFX in relation to what the framework does. The related article, DAO Record Field Exchange: Working with the Wizard Code, continues the discussion. That article introduces the main components of DFX and explains the code that the wizards write to support DFX and how you might want to modify the wizard code.

****Note   ****This article is about the DAO version of record field exchange. If you are using the MFC ODBC classes rather than the MFC DAO classes, see the article Record Field Exchange: Using RFX instead.

Writing calls to the DFX functions in your override is explained in the article DAO Record Field Exchange: Using the DFX Functions.

The following table shows your role in relation to what the framework does for you.

Using DFX: You and the Framework

You... The framework...
Declare your recordset classes with ClassWizard. Specify names and data types of field data members. ClassWizard derives a class and writes a override for you, including a DFX function call for each field data member.
(Optional) Manually add any needed parameter data members to the class. Manually add a DFX function call to DoFieldExchange for each parameter data member, add a call to for the group of parameters, and specify the total number of parameters in . (See DAO: Filtering and Parameterizing Queries for an alternative way to parameterize queries.)
Construct an object of your recordset class. Then, before opening the object, set the values of its parameter data members, if any. (If you create your recordset from a querydef object, you can specify parameters in the querydef.) For efficiency, the framework prebinds the parameters, using DAO. When you pass parameter values, the framework passes them to the DAO data source. Only the parameter values are sent for requeries, unless the sort and/or filter strings have changed.
Open a recordset object using . Executes the recordset’s query, binds columns to field data members of the recordset, and calls to exchange data between the first selected record and the recordset’s field data members.
Scroll in the recordset using or a menu or toolbar command. Calls DoFieldExchange to transfer data to the field data members from the new current record.
Add, update, and delete records. Calls DoFieldExchange to transfer data to the database.

For related information, see class and .

See Also   DAO: Where Is..., DAO Record Field Exchange (DFX), DAO Record Field Exchange: How DFX Works, DAO Recordset