Freigeben über


COleDateTimeSpan::SetStatus

void SetStatus( DateTimeSpanStatus nStatus );

Parameters

nStatus

The new status value for this COleDateTimeSpan object.

Remarks

Call this member function to set the status (validity) of this COleDateTimeSpan object. The nStatus parameter value is defined by the DateTimeSpanStatus enumerated type, which is defined within the COleDateTimeSpan class.

enum DateTimeSpanStatus{
   valid = 0,
   invalid = 1,
   null = 2,
};

For a brief description of these status values, see the following list:

  • COleDateTimeSpan::valid   Indicates that this COleDateTimeSpan object is valid.

  • COleDateTimeSpan::invalid   Indicates that this COleDateTimeSpan object is invalid; that is, its value may be incorrect.

  • COleDateTimeSpan::null   Indicates that this COleDateTimeSpan object is null, that is, that no value has been supplied for this object. (This is “null” in the database sense of “having no value,” as opposed to the C++ NULL.)

Caution   This function is for advanced programming situations. This function does not alter the data in this object. It will most often be used to set the status to null or invalid. Note that the assignment operator (operator =) and SetDateTimeSpan do set the status of the object based on the source value(s).

Example

// if the person is still in school, set date
// of graduation to null
if (m_bStillInSchool || m_dtDateOfGraduation.GetStatus() == COleDateTime::null)
   m_dtDateOfGraduation.SetStatus(COleDateTimeSpan::null);

COleDateTimeSpan OverviewClass MembersHierarchy Chart

See Also   COleDateTimeSpan::GetStatus, COleDateTimeSpan::m_status