Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize


Transfers time and date data between the field data members of a CDaoRecordset object and the columns of a record on the data source.

void AFXAPI DFX_DateTime(
   CDaoFieldExchange* pFX,
   LPCTSTR szName,
   COleDateTime& value,


A pointer to an object of class CDaoFieldExchange. This object contains information to define the context for each call of the function. For more information about the operations a CDaoFieldExchange object can specify, see the article DAO Record Field Exchange: How DFX Works.
The name of a data column.
The value stored in the indicated data member — the value to be transferred. The function takes a reference to a COleDateTime object. For a transfer from recordset to data source, this value is taken from the specified data member. For a transfer from data source to recordset, the value is stored in the specified data member.
An option that lets you take advantage of MFC's double buffering mechanism for detecting recordset fields that have changed. The default, AFX_DAO_ENABLE_FIELD_CACHE, uses double buffering. The other possible value is AFX_DAO_DISABLE_FIELD_CACHE. If you specify this value, MFC does no checking on this field. You must call SetFieldDirty and SetFieldNull yourself.

These options are explained further in the article DAO Recordset: Binding Records Dynamically.

Note   You can control whether data is double buffered by default by setting CDaoRecordset::m_bCheckCacheForDirtyFields.


Data is mapped between type DAO_DATE in DAO and type COleDateTime in the recordset.

Note   COleDateTime replaces CTime and TIMESTAMP_STRUCT for this purpose in the DAO classes. CTime and TIMESTAMP_STRUCT are still used for the ODBC-based data access classes.


See DFX_Text.

See Also

MFC Macros and Globals | DFX_Text | DFX_Bool | DFX_Currency | DFX_Long | DFX_Short | DFX_Single | DFX_Double | DFX_Byte | DFX_Binary | DFX_LongBinary | CDaoFieldExchange::SetFieldType

© 2015 Microsoft