IDataFunctions_4_0::ValidateDateTime

Ee797934.c++_off(en-US,CS.10).gifEe797934.vb_on(en-US,CS.10).gif

Use this method to check whether a string contains a valid date, time, or date and time, and optionally to check against a specified range.

Definition

HRESULT IDataFunctions_4_0::ValidateDateTime(VARIANTvtDate,VARIANTvtMin,VARIANTvtMax,VARIANT*pvtValid);

Parameters

vtDate

[in] A VARIANT that contains the value to validate. This value can be a date, a time, or both.

vtMin

[in] A VARIANT that contains a value specifying the low end of the range. The default value for this parameter is NULL, which means that the vtMin parameter is ignored in the range validation.

vtMax

[in] A VARIANT that contains a value specifying the high end of the range. The default value for this parameter is NULL, which means that the vtMax parameter is ignored in the range validation.

pvtValid

[out, retval] A pointer to a VARIANT used to return a Boolean that indicates whether the vtDate parameter is valid. A value of TRUE indicates the vtDate parameter is a valid date, time, or date/time, and that it is within the given range, if any.

Return Values

This method returns an HRESULT indicating whether it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return a text description of the error.

Remarks

The pvtValid parameter contains valid data only if the method completes successfully.

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

See Also

DataFunctions Object

IDataFunctions_4_0::Date

IDataFunctions_4_0::DateTime

IDataFunctions_4_0::Time

IDataFunctions_4_0::ConvertDateString

IDataFunctions_4_0::ConvertDateTimeString

IDataFunctions_4_0::ConvertTimeString


All rights reserved.