Share via


IProductCatalog3::GetVirtualCatalogRules Method [C++]

Use this method to return a recordset containing the specified virtual catalog rules.

Definition

[C++]

HRESULT IProductCatalog3::GetVirtualCatalogRules(VARIANTlStartingRecord,
  VARIANTlRecordsToRetrieve,
  VARIANTstrPropertyToSortOn,
  VARIANT_BOOLfSortAscending,
  VARIANT*plTotalRecordsInQuery,
  _Recordset**ppRSProductRules);

[Visual Basic]

Function GetVirtualCatalogRules(Optional lStartingRecord As Variant,
  Optional lRecordsToRetrieve As Variant,
  Optional strPropertyToSortOn As Variant,
  Optional fSortAscending As Boolean,
  Optional plTotalRecordsInQuery As Variant) As _Recordset

Parameters

  • lStartingRecord[C++]
    [in, optional] A VARIANT that contains the starting record number. A value of one (1) indicates the first record. If the starting record number is not specified, then this method starts with record one (1).
  • lStartingRecord[Visual Basic]
    A Variant that contains the starting record number. A value of one (1) indicates the first record. If the starting record number is not specified, then this method starts with record one (1).
  • 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.
  • strPropertyToSortOn[C++]
    [in, optional] A VARIANT that contains the property on which to sort. This must be a property in the returned recordset.
  • strPropertyToSortOn[Visual Basic]
    A Variant that contains the property on which to sort. This must be a property in the returned recordset.
  • fSortAscending[C++]
    [in, optional, defaultvalue (-1)] A VARIANT_BOOL that specifies whether to sort in ascending or descending order. A value of True (-1) indicates to sort in ascending order. A value of False (0) indicates to sort in descending order.
  • fSortAscending[Visual Basic]
    A Boolean that specifies whether to sort in ascending or descending order. A value of True (-1) indicates to sort in ascending order. A value of False (0) indicates to sort in descending order. The default value is True.
  • plTotalRecordsInQuery[C++]
    [in, out, optional] A pointer to a VARIANT that, if supplied, contains on output the total number of records.
  • plTotalRecordsInQuery[Visual Basic]
    A Variant that, if supplied, contains on output the total number of records.
  • ppRSProductRules[C++]
    [out, retval] A pointer to hold the reference to the returned Recordset object, which will contain the virtual catalog rules.

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 virtual catalog rules.

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_VC_NOT_A_VIRTUAL_CATALOG

[C++] 0x889800FA

[Visual Basic] &H889800FA

invalid catalog type. This API can only be called on a virtual catalog.
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.

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

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

Field Data Type Description
Type VirtualCatalogRuleTypeEnum Enum An enumeration that describes the type of rule. See the following table for a description of the values.
CatalogName String
90 characters
The name of the catalog.
CategoryName String
128 characters
The name of the category.
ProductID String
256 characters
The field name that uniquely identifies products.
VariantID String
256 characters
The field name that uniquely identifies variants.

The following table shows the enumeration that indicates the rule types in the returned recordset.

Name Value Description
VCRULETYPE_INCLUDE_PRODUCT 1 Indicates an inclusion rule for a product.
VCRULETYPE_EXCLUDE_PRODUCT 2 Indicates an exclusion rule for a product.
VCRULETYPE_INCLUDE_CATEGORY 3 Indicates an inclusion rule for a category.
VCRULETYPE_EXCLUDE_CATEGORY 4 Indicates an exclusion rule for a category.
VCRULETYPE_INCLUDE_VARIANT 5 Indicates an inclusion rule for a variant.
VCRULETYPE_EXCLUDE_VARIANT 6 Indicates an exclusion rule for a variant.

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

[Visual Basic]

Example

vTotalRecords is a variant.
SET rsRules = myProductCatalog.GetVirtualCatalogRules(1, 25, strPropertyToSortOn, True, vTotalRecords )

See Also

[C++]ProductCatalog Object

[Visual Basic]ProductCatalog Object

Copyright © 2005 Microsoft Corporation.
All rights reserved.