ProductCatalog.PerformSpecificationSearch
Use this method to perform a specification search of a catalog.
Definition
Function PerformSpecificationSearch(strSearchHandle As String,Optional eClassTypeRequired As Variant,Optional lDesiredRecords As Variant,Optional plTotalRecordsAvailable As Variant,Optional pRSNewPropValuesList As Variant,Optional vrPropertiesRequired As Variant) As _Recordset
Parameters
strSearchHandle
A String that contains the name of the search to perform.
eClassTypeRequired
A Variant that contains the catalog class desired. Valid values are from the CatalogClassTypeEnum enumeration, and are described in the Remarks section below.
lDesiredRecords
A Variant that contains the records desired.
plTotalRecordsAvailable
A Variant used to return the total number of records available.
pRSNewPropValuesList
A Variant used to return the Recordset of the new property values list.
vrPropertiesRequired
A Variant that contains the properties required in a comma-delimited String.
Return Values
If this method completes successfully, it returns a recordset that contains the search results.
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 |
S_FALSE | &H00000001 | This value is returned when the pRSNewPropValuesList parameter is supplied and:
|
E_CAT_CATEGORY_NOT_EXISTS_NOT_SEARCHABLE | &H88980049 | The category you specified did not exist or was not specification searchable. |
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 PerformSpecificationSearch method executes a query using all of the constraints that have been added to the specified specification search handle.
The optional output parameter, pRSNewPropValuesList, is a single row recordset. This recordset contains one field for each searchable property for the products under the category specified in the BeginSpecificationSearch method. Each field contains a SAFEARRAY. The SAFEARRAY contains a set of distinct values for that property. The set is all the values in all the products that match the search clauses in the search handle. Only the properties that are marked as searchable are returned in the recordset. A property can be marked as searchable by setting the IncludeInSpecSearch attribute of that property to True.
The Recordset object returned by this method will contain a field for each property name in the vrPropertiesRequired parameter. It will always contain a CatalogName field. If the parameter is omitted, the Recordset object will contain all of the corresponding fields. For more information about these fields, see CatalogProduct Recordset.
Note
- When field names begin with a number or contain spaces they must be enclosed in brackets. Data errors will occur if the field names are not formatted correctly. For example, "[123_Prop1],[123_ Prop2]". If the vrPropertiesRequired property is omitted then the data in all fields will be returned correctly.
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. |
CatalogClassTypeEnum values can be combined in the eClassTypeRequired parameter with logical OR operators, so that specifying cscProductClass OR cscProductVariantClass 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.
Example
'strSearchHandle contains a search handle returned
'from AddSpecificationSearchClause or BeginSpecificationSearch
'The following parameters should be examined after the call returns.
'plTotalRecordsAvailable is a Long
'pRSNewPropValuesList is an empty recordset
SET rsSearchResults = myProductCatalog.PerformSpecificationSearch(strSearchHandle, 20, plTotalRecordsAvailable, pRSNewPropValuesList)
See Also
ProductCatalog.AddSpecificationSearchClause
ProductCatalog.BeginSpecificationSearch
ProductCatalog.GuaranteedSpecificationSearch