The information in this article applies to:
SUMMARY
The RFX_Date() record field exchange function 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.
NOTE: The code in the following sample is not needed if you are using MFC version 3.1 or above (i.e. VC++ 2.1 or greater). MFC version 3.1 and above includes an overloaded RFX_Date function that takes a TIMESTAMP_STRUCT. In this case, simply changing the declaration of the recordset members to TIMESTAMP_STRUCT and modifying any initializations of those members is sufficient.
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 use the standard precompiled header STDAFX.H then you may need to add header files to 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. MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files: http://www.microsoft.com/downloads/search.aspand then click How to use the Microsoft Download Center. 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:
Be sure to include RFXDATE.H in the source file that calls RFX_Date().
Additional query words:
Keywords : kbfile kbsample kb2000 kbDatabase kbMFC kbODBC kbVC |
Last Reviewed: December 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |