Share via


DBStorage.DeleteData

Ee825686.c++_on(en-US,CS.10).gifEe825686.vb_off(en-US,CS.10).gif

Use this method to delete a row from the data source, based on the data stored in the specified Dictionary or OrderForm object.

Definition

Sub DeleteData(vtReserved As Variant,pdispData As Object)

Parameters

vtReserved

A Variant reserved for future use. This parameter is ignored by the DeleteData method.

pdispData

An object reference to the data object to delete. This data object can be either an OrderForm or a Dictionary, but must correspond in type to the object type specified as the ProgID in the initial call to the InitStorage method.

Return Values

None.

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

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.

Thus, if you specify an IDENTITY field in an SQL table as the key into the data source, you can delete all the columns for a specified row by simply providing the appropriate counter value. Alternatively, you can initialize a Dictionary object to the values stored in one or more columns, and pass this initialized object to the DeleteData method.

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

Example

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

Order.order_id = "Order_tmp"
OrderFormStorage.DeleteData(Null, Order)

See Also

DBStorage Object

DBStorage.InitStorage

DBStorage.DeleteDataKey

DBStorage.InsertData


All rights reserved.