AppFrameWork.RequestDate

Ee825061.c++_on(en-US,CS.10).gifEe825061.vb_off(en-US,CS.10).gif

Use this method to retrieve a value from a URL query string or form post variable and convert it to a Date value (Date Variant), based on the specified or default locale.

Definition

Function RequestDate(bstrName As String,Optional vtDefault As Variant,Optional vtMin As Variant,Optional vtMax As Variant,Optional vtLocale As Variant) As Variant

Parameters

bstrName

A String that contains the name of the URL query string or form post variable to retrieve.

vtDefault

A Variant that contains the date to return if the requested URL query string or form post variable does not exist or contains no value. If this parameter is not supplied, the method returns NULL. The default cannot contain DateTime or Time values. This parameter is optional.

vtMin

A Variant that contains a date value that specifies the low end of the range against which to validate the value of the bstrName parameter. The default value is NULL, indicating that this parameter is ignored. If the converted value is less than vtMin, then NULL is returned. This parameter is optional.

vtMax

A Variant that contains a date value that specifies the high end of the range against which to validate the value of the bstrName parameter. The default value is NULL, indicating that this parameter is ignored. If the converted value is greater than vtMax, then NULL is returned. This parameter is optional.

vtLocale

A Variant that that contains a number that specifies the locale to use to convert the date. If this value is not specified, the RequestDate method uses the value of the Locale property of the DataFunctions object. This parameter is optional.

Return Values

If this method completes successfully, it returns a Date Variant that contains the processed date value. If any validation fails, the return value will be NULL.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM 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. In particular, the Description property may contain a text description of the error.

Remarks

This method converts the specified String based on the locale specified in the vtLocale parameter if the vtLocale parameter is specified; otherwise it uses the default locale found in the DataFunctions object. It validates the result of the conversion against the vtMin and vtMax parameters, if they are specified. If the validation fails this method returns NULL.

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

Example

' oAppFrameWork is a Commerce.AppFrameWork object.
' This example assumes that the date value is entered using 
' the following form:
<FORM METHOD ="POST" ACTION="PROCESS.ASP">
<INPUT TYPE="Text" NAME="Date">
<INPUT TYPE="SUBMIT" NAME="ACTION" VALUE="Send Info">
</FORM>
' If the user enters the date into the form and clicks the 
' Send Info button, the value of this form field can be 
' retrieved by the RequestDate method as follows:
vDate = oAppFrameWork.RequestDate("Date", "2/27/01", "1/1/01", _
    "12/31/01",1033)

See Also

AppFrameWork Object

DataFunctions.Locale

AppFrameWork.RequestDateTime

DataFunctions.ConvertDateString

DataFunctions.Date


All rights reserved.