IProduct3::get_Variants Property [C++]

The Variants property is a read-only recordset that describes all of the variants of this product.

Definition

[C++]

HRESULT IProduct3::get_Variants(VARIANTstrPropertyToSortOn,
  _Recordset**Variants);

[Visual Basic]

Property Variants(Optional strPropertyToSortOn As Variant) As Recordset

Parameters

  • strPropertyToSortOn[C++]
    [in, optional] A VARIANT that contains the property on which the returned Recordset object is to be sorted. This must be a property in the returned recordset. If not included, the returned recordset will be unsorted.
  • strPropertyToSortOn[Visual Basic]
    A Variant that contains the property on which the returned Recordset object is to be sorted. This must be a property in the returned recordset. If not included, the returned recordset will be unsorted.
  • Variants[C++]
    [out, retval] A pointer to a _Recordset object used to return the variants.

[C++]

Return Values

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

Error Values

[C++] This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. 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] This property sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. Additional information may be available using the global Err object. In particular, the Description property may contain a text description of the error.

The following table describes the custom COM errors 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_INVALID_SORT_PROPS

[C++] 0x8898011E

[Visual Basic] &H8898011E

The properties to sort that you specified are invalid. Properties that contain a space should be enclosed in square brackets. Properties should not contain [ or ] and /* or -- in property names.

Remarks

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

The returned recordset will contain one row for each variant of this product. If this product has no variants, the returned recordset will be empty, and its EOF property will be set to VARIANT_TRUE.

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.

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

[Visual Basic]

Example

SET rsVariants = myProduct.Variants("Size")

See Also

[C++]Product Object

[Visual Basic]Product Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.