Product.GetVariantProperties

Ee797984.c++_on(en-US,CS.10).gifEe797984.vb_off(en-US,CS.10).gif

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

Definition

Function GetVariantProperties(varProductVariantID As Variant) As Recordset

Parameters

varProductVariantID

A Variant that contains the unique ID of the product variant.

Return Values

If this method completes successfully, it returns a Recordset object that contains the variant properties.

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 errors that this method can return.

Constant Value Description
E_CAT_CATALOG_DOESNT_SUPPORT_VARIANTS &H88980032 This catalog does not support product variants.
E_CAT_VARIANT_DOESNT_EXIST &H8898001F This product variant has been removed from the catalog.

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 ppRSProductVariant property contains valid data only if it was accessed successfully.

This method returns the properties of the specified product variant. If the product variant specified in the varProductVariantID parameter does not exist in the product, the method will fail.

The single-row recordset returned contains fields for all of the properties defined for variants of this product followed by the following fields:

Field Type Description
TimeStamp Timestamp None
cy_list_price Currency List price
oid Integer None

The oid field is for internal use only and should not be updated.

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

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

Example

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

See Also

Product Object

Product.SetVariantProperties


All rights reserved.