IMSCSDBStorage_3_0::DeleteDataKey Method [C++]

Use this method to delete a row of data, based on the specified key value.

Definition

[C++]

HRESULT IMSCSDBStorage_3_0::DeleteDataKey(VARIANTvtReserved,
 VARIANTvtKey);

[Visual Basic]

Sub DeleteDataKey(vtReserved As Variant,
 vtKey As Variant)

Parameters

  • vtReserved[C++]
    [in] This parameter is reserved for future use and is ignored by the current implementation of the DeleteDataKey method. This parameter is required for compatibility with Site Server 3.0 Commerce Edition, but is not used.
  • vtReserved[Visual Basic]
    This parameter is reserved for future use and is ignored by the current implementation of the DeleteDataKey method. This parameter is required for compatibility with Site Server 3.0 Commerce Edition, but is not used.
  • vtKey[C++]
    [in] A VARIANT that contains the key value for the row to delete. This key corresponds to the column designated as the table key in the initial call to the InitStorage method. Thus, if the call to the InitStorage method specifies column "some_column" as the table key, then the DeleteDataKey method searches "some_column" for the value stored in the vtKey parameter, and deletes the corresponding row of data.
  • vtKey[Visual Basic]
    A Variant that contains the key value for the row to delete. This key corresponds to the column designated as the table key in the initial call to the InitStorage method. Thus, if the call to the InitStorage method specifies column "some_column" as the table key, then the DeleteDataKey method searches "some_column" for the value stored in the vtKey parameter, and deletes the corresponding row of data.

Return Values

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

[Visual Basic] None.

Error Values

[C++] 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.

[Visual Basic] 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

The DeleteDataKey method differs from the DeleteData method in that the DeleteDataKey requires only the value stored in the key column of the underlying table. This is the column specified as the key to the underlying table through a previous call to the InitStorage method.

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

[Visual Basic]

Example

' Order is a Commerce.OrderForm object; OrderFormStorage is 
' an initialized Commerce.DBStorage object

Order.shopper_id = "Shopper_tmp"
OrderFormStorage.DeleteDataKey(Null, "1234567890WSXCDERFVBGTRESWER")

See Also

[C++]DBStorage Object

[C++]IMSCSDBStorage_3_0::InitStorage

[C++]IMSCSDBStorage_3_0::DeleteData

[C++]IMSCSDBStorage_3_0::InsertData

[Visual Basic]DBStorage Object

[Visual Basic]DBStorage.InitStorage

[Visual Basic]DBStorage.DeleteData

[Visual Basic]DBStorage.InsertData

Copyright © 2005 Microsoft Corporation.
All rights reserved.