IProductCatalog3::GetProductVariant Method [C++]

Use this method to retrieve the properties of a specified product variant.

Definition

[C++]

HRESULT IProductCatalog3::GetProductVariant(VARIANTvarProductID,
 VARIANTvarVariantID,
 _Recordset**ppRSVariant);

[Visual Basic]

Function GetProductVariant(varProductID As Variant,
 varVariantID As Variant) As _Recordset

Parameters

  • varProductID[C++]
    [in] A VARIANT that contains the unique identifier of the product family.
  • varProductID[Visual Basic]
    A Variant that contains the unique identifier of the product family.
  • varVariantID[C++]
    [in] A VARIANT that contains the unique identifier of the product variant.
  • varVariantID[Visual Basic]
    A Variant that contains the unique identifier of the product variant.
  • ppRSVariant[C++]
    [out, retval] A pointer to hold the reference to the returned Recordset object, which will contain the properties of the variant.

Return Values

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

[Visual Basic] If this method completes successfully, it returns a recordset that contains the properties of the specified variant.

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_INVALID_RS_POINTER

[C++] 0x889800B7

[Visual Basic] &H889800B7

The recordset pointer that you specified is invalid
E_CAT_CATALOG_DOESNT_SUPPORT_VARIANTS

[C++] 0x88980032

[Visual Basic] &H88980032

This catalog does not support variants. In order to support variants the catalog has to be created with the variant identifier.
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_INVALIDVALUE_FOR_PRODUCTID

[C++] 0x8898004E

[Visual Basic] &H8898004E

The value you specified for the ProductID is either out of range or does not satisfy the Min/Max condition.
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_VARIANTID

[C++] 0x8898005C

[Visual Basic] &H8898005C

The value you specified for the VariantID exceeds the maximum allowed length of 256 characters.
E_CAT_INVALIDVALUE_FOR_VARIANTID

[C++] 0x8898004D

[Visual Basic] &H8898004D

The value you specified for the VariantID is either out of range or does not satisfy the Min/Max condition.
E_CAT_BLANK_VARIANT

[C++] 0x8898004F

[Visual Basic] &H8898004F

You have specified a blank value for the VariantID. A variant cannot be created with a blank value.

[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

[C++] The ppRSVariant parameter contains valid data only if the method was accessed successfully.

A single row recordset with all the properties of the variant is returned. The fields of the returned recordset are determined by the properties associated with the definition on which it is based. Both the product properties and the variant properties are returned.

The returned recordset is disconnected and updateable. The following table shows the fields that the returned recordset contains.

Field Data Type Description
oid int Internal identifier
Cy_list_price money List price of the variant
TimeStamp timestamp None
ProductID String
128 characters
The field name that uniquely identifies products.

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

[Visual Basic]

Example

SET rsVariantProps = myProductCatalog.GetProductVariant("SKU4007", "Blue")

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

[C++]IProductCatalog3::get_IdentifyingVariantProperty

[Visual Basic]ProductCatalog.IdentifyingVariantProperty

Copyright © 2005 Microsoft Corporation.
All rights reserved.