ProductCatalog.DeleteProduct

Ee823443.c++_on(en-US,CS.10).gifEe823443.vb_off(en-US,CS.10).gif

Use this method to delete a product from the Product Catalog System.

Definition

Sub DeleteProduct(varProductID As Variant)

Parameters

varProductID

A Variant that contains the unique identifier of the product to be deleted.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to either standard or custom COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.

The following table shows the custom COM error that this method can return.

Constant Value Description
E_CAT_CATALOG_DOESNT_EXIST &H88980002 The catalog did not exist.
E_CAT_PRODUCT_DOESNT_EXIST &H88980010 The specified product did not exist.

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 removes the product from the SQL Server database. The Product object caches information for improved performance. Because of this cache, the  CatalogName and ProductID methods of the Product object will continue to return the old values after the DeleteProduct method has been called. The Variants, ParentCategories, AncestorCategories, RelatedCategories, and RelatedProducts properties will return an empty recordset and no error message.

Ee823443.caution(en-US,CS.10).gif Caution

  • Deleting a product with variants also deletes all of the variants.

Example

myProductCatalog.DeleteProduct 654321

See Also

ProductCatalog Object

ProductCatalog.CreateProduct

ProductCatalog.GetProduct


All rights reserved.