IMSCSPage_3_0::RequestDefault
Use this method to retrieve a value from a URL query string or form post variable and return the value as a string.
Important
- This method is included for backwards compatibility with Site Server 3.0 Commerce Edition.
Definition
HRESULT IMSCSPage_3_0::RequestDefault(BSTRbstrName,VARIANTvtDefault,VARIANT*pvtRet);
Parameters
bstrName
[in] A BSTR that contains the name of the URL query string variable to retrieve.
vtDefault
[in] A VARIANT that contains the value to return if the requested URL query string or form post variable contains an empty or a NULL value, or is not present in the request string. If this parameter is not supplied, the method returns NULL.
pvtRet
[out, retval] A pointer to a VARIANT used to return the processed value as a string.
Return Values
This method returns an HRESULT indicating whether or not 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 *pvtRet*****parameter points to valid data only if the method completed successfully.
This method is designed so that if a field on a form is blank, or the form does not contain the field, the value returned by default is NULL. NULL is generally the appropriate value to store to a database when a value is not present. If you need the result to be an empty string in the case of a missing value, supply an empty string as the Default parameter.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.