Dela via


RFX_Date

Transfers CTime or TIMESTAMP_STRUCT data between the field data members of a CRecordset object and the columns of a record on the data source of ODBC type SQL_DATE, SQL_TIME, or SQL_TIMESTAMP.

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

Parameters

  • pFX
    A pointer to an object of class CFieldExchange. This object contains information to define the context for each call of the function. For more information about the operations a CFieldExchange object can specify, see the article Record Field Exchange: How RFX Works.

  • szName
    The name of a data column.

  • value
    The value stored in the indicated data member; the value to be transferred. The various versions of the function take different data types for value:

    The first version of the function takes a reference to a CTime 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.

    The second version of the function takes a reference to a TIMESTAMP_STRUCT structure. You must set up this structure yourself before the call. Neither dialog data exchange (DDX) support nor code wizard support is available for this version. The third version of the function works similarly to the first version except that it takes a reference to a COleDateTime object.

Remarks

The CTime version of the function imposes the overhead of some intermediate processing and has a somewhat limited range. If you find either of these factors too limiting, use the second version of the function. But note its lack of code wizard and DDX support and the requirement that you set up the structure yourself.

Example

See RFX_Text.

Requirements

Header: afxdb.h

See Also

Concepts

MFC Macros and Globals

Reference

RFX_Text

RFX_Bool

RFX_Long

RFX_Int

RFX_Single

RFX_Double

RFX_Byte

RFX_Binary

RFX_LongBinary

CFieldExchange::SetFieldType