IProduct3::GetVariantProperties Method [C++]

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

Definition

[C++]

HRESULT IProduct3::GetVariantProperties(VARIANTvarProductVariantID,
  _Recordset**ppRSProductVariant);

[Visual Basic]

Function GetVariantProperties(varProductVariantID As Variant) As Recordset

Parameters

  • varProductVariantID[C++]
    [in] A VARIANT that contains the unique ID of the product variant.
  • varProductVariantID[Visual Basic]
    A Variant that contains the unique ID of the product variant.
  • ppRSProductVariant[C++]
    [out, retval] A pointer to a Recordset object used to return the product variant properties.

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 object that contains the variant properties.

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 variant identifier.
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_VC_INVALID_VARIANT_ID

[C++] 0x889800FC

[Visual Basic] &H889800FC

The value you specified for the VariantID exceeds the maximum allowed length of 348 characters.
E_CAT_VARIANT_DOESNT_EXIST

[C++] 0x8898001F

[Visual Basic] &H8898001F

The product-variant you specified doesn't exist.

[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 ppRSProductVariant parameter contains valid data only if the method was accessed successfully.

This method returns the properties of the specified product variant. Multilingual properties will be returned in the current language of the catalog. If the product variant specified in the varProductVariantID parameter does not exist in the product, the method will fail.

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 OID field is used internally by the Product Catalog System and should not be updated.

The recordset returned is updateable, but disconnected. To modify the product properties, pass this recordset to the SetVariantProperties method.

The returned recordset contains the fields listed in the following table.

Field Data Type
oid int
cy_list_price money
Timestamp timestamp
ProductID string

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

[Visual Basic]

Example

'vVarID is a Variant containing the unique ID of the variant.
SET rsVariantProps = myProduct.GetVariantProperties(vVarID)

See Also

[C++]Product Object

[Visual Basic]Product Object

[C++]IProduct3::SetVariantProperties

[Visual Basic]Product.SetVariantProperties

Copyright © 2005 Microsoft Corporation.
All rights reserved.