----------------------------------------------------------------------
The information in this article applies to:

 - Microsoft Foundation Classes for Windows, version 2.5
----------------------------------------------------------------------

SUMMARY
=======

The RFX_Date() record field exchange function included with Visual 
C++ version 1.5 for Windows transfers data from a date/time field to 
a CTime object. AppWizard/ClassWizard will use this RFX_Date() 
function when mapping date/time fields to variables.

The CTime object doesn't allow dates before the year 1970 and after 
the year 2038. Therefore, it may be better to use a TIMESTAMP_STRUCT 
(defined in the SQLEXT.H) to retrieve the date/time information. 

The structure TIMESTAMP_STRUCT is defined as:

    typedef struct tagTIMESTAMP_STRUCT
    {
        SWORD year;
        UWORD month;
        UWORD day;
        UWORD hour;
        UWORD minute;
        UWORD second;
        UDWORD fraction;
    } TIMESTAMP_STRUCT;

The RFXDTE sample contains two files; RFXDATE.H and RFXDATE.CPP.  
These define a RFX_Date() function which accepts a TIMESTAMP_STRUCT 
reference. To use the function, you need to include the .CPP file 
into your project.  If your project doesn't used the standard 
precompiled header STDAFX.H then you may need to change the header 
files which are included at the top of the .CPP file.  Either in
your precompiled header or the RFXDATE.CPP file, you must include 
AFXWIN.H, AFXEXT.H, and AFXDB.H.   

RFXDTE can be found in the Software/Data Library by searching on the word
RFXDTE, the Q number of this article, or Sxxxxx. RFXDTE was archived 
using the PKware file-compression utility.

MORE INFORMATION
================                                 

Record field exchange (RFX) functions are called in the 
DoFieldExchange() function of a CRecordset.  RFX functions handle 
the transfer of data from a field of a resultset 
(table that results from an SQL query) and the data members of 
a CRecordset object.

To use the RFX_Date function in the RFXDTE sample, first define a
TIMESTAMP_STRUCT member of a CRecordset class.  Then, pass the 
variable as the third parameter to the RFX routine. The prototype 
for the function is:

void RFX_Date(CFieldExchange* pFX, const char *szName,
    TIMESTAMP_STRUCT& value);

Be sure to include RFXDATE.H in the source file that calls 
RFX_Date().
