_OrderGroup::Initialize

Ee826081.c++_off(en-US,CS.10).gifEe826081.vb_on(en-US,CS.10).gif

Use this method to initialize the OrderGroup object.

Definition

HRESULT _OrderGroup::Initialize(BSTRstrConnectionString,BSTRstrUser ID);

Parameters

strConnectionString

[in] A BSTR that contains the database connection string.

strUser ID

[in] A BSTR that specifies the user ID. All Commerce Server 2000 user ID values are GUIDs.

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

Use this method to specify the connection string that the OrderGroup uses for its database operations. You also specify a user_id that the object will use as an OrderGroup_id when performing basket operations. This same user_id value will be stored in the g_User IDChangedBy field.

Ee826081.note(en-US,CS.10).gif Note

  • If you are loading an OrderGroup on behalf of another user (for example as an administrator), you should specify the administrator user ID (or a placeholder user ID GUID which signifies administrative authority) so that g_UserDChangedBy is updated with the appropriate value when the OrderGroup is saved back to the database. If you wish to load an OrderGroup with a Basket status in the role of an administrator, you must specify strUser ID as the user ID of the user whose basket you wish to load. In this case g_User IDChangedBy will not be updated with an administrator user ID.

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

See Also

OrderGroup Object


All rights reserved.