IProductCatalog::BeginSpecificationSearch

Ee784509.c++_off(en-US,CS.10).gifEe784509.vb_on(en-US,CS.10).gif

Use this method to initialize a specification search of a catalog.

Definition

HRESULT IProductCatalog::BeginSpecificationSearch(BSTRstrCategoryName,VARIANT*pRSInitialPropValuesList,VARIANT*plTotalRecordsAvailable,BSTR*pstrSearchHandle);

Parameters

strCategoryName

[in] A BSTR that contains the name of the category in which to search.

pRSInitialPropValuesList

[out, optional] A pointer to a VARIANT used to return the recordset of initial property values.

plTotalRecordsAvailable

[out, optional] A pointer to a VARIANT used to return the total records available.

pstrSearchHandle

[out, retval] A BSTR used to return the state of the specification search.

Return Values

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

Error Values

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.

The following table shows the custom COM errors that this method can return.

Constant Value Description
E_CAT_CATEGORY_DOESNT_EXIST 0x88980041 The category you specified did not exist in the catalog.
E_CAT_CATEGORY_NOT_SEARCHABLE 0x88980034 The specified category was not specification searchable.

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.

Remarks

The pRSInitialPropValuesList and pstrSearchHandle parameters contain valid data only if the property was accessed successfully.

The optional parameter pRSInitialPropValuesList is a single row recordset. The returned recordset contains one field for each searchable property for the products under the specified category. Each field contains a SAFEARRAY. Each SAFEARRAY contains a set of all the distinct values found in all the products under that category. Only the properties that are marked as searchable are returned in the recordset.

If all the searchable categories contain NULL values then pRSInitialPropValuesList parameter will be set to NULL and the plTotalRecordsAvailable parameter will be 0.

A category can be marked as searchable by setting the IsSearchable property to True.

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

See Also

ProductCatalog Object

IProductCatalog::AddSpecificationSearchClause

IProductCatalog::GetSpecificationSearchClauses

IProductCatalog::PerformSpecificationSearch


All rights reserved.