Share via


ICategory3::get_Products Property [C++]

The Products property is a read-only recordset that contains product data for all of the products that exist directly within this category.

Definition

[C++]

HRESULT ICategory3::get_Products(VARIANTeClassTypeRequired,
  VARIANTstrPropertyToSortOn,
  VARIANTlStartingRecord,
  VARIANTlRecordsToRetrieve,
  VARIANT*plTotalRecordsInQuery,
  _Recordset**Products);

[Visual Basic]

Property Products(Optional eClassTypeRequired As Variant,
  Optional strPropertyToSortOn As Variant,
  Optional lStartingRecord As Variant,
  Optional lRecordsToRetrieve As Variant,
  Optional plTotalRecordsInQuery As Variant) As Recordset

Parameters

  • eClassTypeRequired[C++]
    [in, optional] A VARIANT that contains the catalog class wanted. Valid values are from the CatalogClassTypeEnum enumeration. For more information, see the Remarks section.
  • eClassTypeRequired[Visual Basic]
    A Variant that contains the catalog class wanted. Valid values are from the CatalogClassTypeEnum enumeration. For more information, see the Remarks section.
  • strPropertyToSortOn[C++]
    [in, optional] A VARIANT that contains the property to sort on. 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 to sort on. This must be a property in the returned recordset. If not included, the returned recordset will be unsorted.
  • lStartingRecord[C++]
    [in, optional] A VARIANT that contains the starting record number. A value of one (1) indicates the first record.
  • lStartingRecord[Visual Basic]
    A Variant that contains the starting record number. A value of one (1) indicates the first record.
  • lRecordsToRetrieve[C++]
    [in, optional] A VARIANT that contains the number of records to retrieve.
  • lRecordsToRetrieve[Visual Basic]
    A Variant that contains the number of records to retrieve.
  • plTotalRecordsInQuery[C++]
    [out, optional] A pointer to a VARIANT used to return the total number of records in the query.
  • plTotalRecordsInQuery[Visual Basic]
    A Variant used to return the total number of records in the query.
  • Products[C++]
    [out, retval] A _Recordset object used to return the products.

[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_INVALIDARG

[C++] 0x80070057

[Visual Basic] &H80070057

One or more arguments are 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 Products parameter contains valid data only if the property is accessed successfully.

If the properties specified in the strPropertyToSortOn parameter are invalid, then the recordset will be unsorted.

If the cscCategoryClass value is specified for the eClassTypeRequired parameter, the returned recordset will contain all the products and all the child categories in this category.

The Products property contains the product data for all the products in this category.

[C++] The returned recordset contains all the fields in the CatalogProduct Recordset.

[Visual Basic] The returned recordset contains all the fields in the CatalogProduct Recordset.

If this category contains no products, then the Products property returns an empty recordset whose EOF property is set to VARIANT_TRUE.

The following table shows the values of the CatalogClassTypeEnum enumeration, their associated names, and describes their use.

Name Value Description
cscCategoryClass 1 Requests category data.
cscProductVariantClass 2 Requests product variant data.
cscProductClass 4 Requests product data.
cscProductFamilyClass 8 Requests product family data.
cscProductFamilyForVariantsClass 16 Requests family for variant data, which means the product family of a product variant is being requested.
CscProductVariantsForFamily 32 Requests variants for family data, which means that all of the product variants for a product family are being requested.

The CatalogClassTypeEnum enumeration values can be combined in the eClassTypeRequired parameter with logical OR operators, so that specifying cscProductClassORcscProductVariantClass will return both product and product variant data.

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

See Also

[C++]Category Object

[C++]ICategory3::get_DescendantProducts

[C++]ICategory3::get_RelatedProducts

[Visual Basic]Category.DescendantProducts

[Visual Basic]Category Object

[Visual Basic]Category.RelatedProducts

Copyright © 2005 Microsoft Corporation.
All rights reserved.