Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Use this method to remove a relationship between the specified product in the specified catalog and this category.
Definition
[C++]
HRESULT ICategory3::RemoveRelationshipToProduct(VARIANTvarRelatedProductID,
BSTRstrRelationshipNameBSTRstrCatalogName);
[Visual Basic]
Sub RemoveRelationshipToProduct(varRelatedProductID As Variant,
strRelationshipName As StringstrCatalogName As String)
Parameters
- varRelatedProductID[C++]
[in] A VARIANT that contains the ID of the related product. - varRelatedProductID[Visual Basic]
A Variant that contains the ID of the related product. - strRelationshipName[C++]
[in] A BSTR that contains the name of the relationship. - strRelationshipName[Visual Basic]
A String that contains the name of the relationship. - strCatalogName[C++]
[in] A BSTR that contains the name of the catalog containing the name of the related product. - strCatalogName[Visual Basic]
A String that contains the name of the catalog containing the name of the related product.
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 either standard or custom COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors.
[Visual Basic] 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 errors that this method can return.
| Constant | Value | Description |
|---|---|---|
| E_CAT_CATALOG_DOESNT_EXIST | [C++] 0x88980002 [Visual Basic] &H88980002 |
The catalog name you specified does not exist. |
| E_CAT_INVALID_CATALOGNAME | [C++] 0x88980063 [Visual Basic] &H88980063 |
The catalog name you specified is invalid. catalog names cannot be blank |
| E_CAT_INVALID_CATALOG_NAME_LENGTH | [C++] 0x88980042 [Visual Basic] &H88980042 |
The catalog name you specified exceeds the maximum limit of 85 characters. |
| E_CAT_CHARACTER_NOT_ALLOWED | [C++] 0x8898003D [Visual Basic] &H8898003D |
The catalog name you specified has one of the nine reserved characters " [ ] , ' ( )#. which should not be used. |
| E_CAT_INVALID_PRODUCTID | [C++] 0x8898005B [Visual Basic] &H8898005B |
The value you specified for the ProductID is blank or else it exceeds the maximum allowed length of 256 characters. |
| E_CAT_VC_INVALID_PROD_ID_OR_CATEGORY_NAME | [C++] 0x889800FB [Visual Basic] &H889800FB |
The value you specified for the ProductID or CategoryName exceeds the maximum allowed length of 348 characters. |
| E_CAT_INVALID_CATEG_LENGTH | [C++] 0x88980047 [Visual Basic] &H88980047 |
The category name you specified is either blank or exceeds the maximum allowed length of 128 characters or cannot be converted to a string. |
| E_CAT_INVALID_RELATION_NAME | [C++] 0x88980054 [Visual Basic] &H88980054 |
The value you specified for the relationship name is blank or exceeds 128 characters. Relationship names should not be blank and should be less than or equal to 128 characters. |
| E_CAT_INVALID_PARAMETER | [C++] 0x889800B6 [Visual Basic] &H889800B6 |
The input parameter <parameter number> is invalid. |
| E_CAT_PRODUCT_DOESNT_EXIST | [C++] 0x8898001E [Visual Basic] &H8898001E |
The product you specified doesn't exist. |
| E_CAT_CATEGORY_DOESNT_EXIST | [C++] 0x8898001C [Visual Basic] &H8898001C |
The category you specified doesn't exist. |
| E_CAT_DEFN_NO_RELATIONSHIP_EXISTS | [C++] 0x88980045 [Visual Basic] &H88980045 |
The relationship that you specified either does not exist or is a inherited relationship, and therefore cannot be edited. |
| E_CAT_VC_ERROR_IN_PROPAGATING_BC_CHANGES | [C++] 0x88980101 [Visual Basic] &H88980101 |
There was an error in propagating the base catalog changes to the dependent virtual catalogs. |
[C++] 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] 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 RemoveRelationshipToProduct method removes a relationship between this category and the product identified by the varRelatedProductID parameter. Since more than one relationship may exist between this category and product, you must also specify the name of the relationship you want to remove in the strRelationshipName parameter. If the product specified in the varRelatedProductID parameter does not exist or the relationship specified in the strRelationshipName parameter does not exist, then this method will fail.
When calling this method on an inherited category in a virtual catalog, if the relationship is inherited from a base catalog, the method will return an error: "The relationship that you specified either does not exist or is an inherited relationship, and therefore cannot be edited." If the relationship was added in the virtual catalog, it will be removed. Inherited hierarchy and relationship links cannot be removed or changed in inherited categories. To modify inherited relationships use a Category object obtained from the base Catalog object.
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.
[Visual Basic]
Example
myCategory.RemoveRelationshipToProduct "Gadget", "FeaturedProduct"
See Also
[C++]Category Object
[C++]ICategory3::AddRelationshipToProduct
[Visual Basic]Category Object
[Visual Basic]Category.AddRelationshipToProduct
Copyright © 2005 Microsoft Corporation.
All rights reserved.