ICatalogManager::CreateCatalog
Use this method to create a new catalog.
Definition
HRESULT ICatalogManager::CreateCatalog(BSTRstrCatalogName,BSTRstrProductID,VARIANTstrProductVariantID,VARIANTlcidLocale,VARIANTstrCurrency,VARIANTstrWeightMeasure,VARIANTdtStartDate,VARIANTdtEndDate,IProductCatalog**ppNewCatalog);
Parameters
strCatalogName
[in] A BSTR that contains the name of the catalog to be created. See the Remarks section for a list of restricted characters.
strProductID
[in] A BSTR that contains the product ID property.
strProductVariantID
[in, optional] A VARIANT that contains the product variant ID property.
lcidLocale
[in, optional] A VARIANT that contains the locale ID (LCID) of the catalog to be created.
strCurrency
[in, optional] A VARIANT that contains the currency type of the catalog to be created.
strWeightMeasure
[in, optional] A VARIANT that contains the unit of weight or measure of the catalog to be created.
dtStartDate
[in, optional] A VARIANT of subtype DATE that contains the start date.
dtEndDate
[in, optional] A VARIANT of subtype DATE that contains the end date.
ppNewCatalog
[out, retval] A pointer used to return the IProductCatalog interface of the new catalog.
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_CATALOG_EXISTS | 0x88980001 | There was already a catalog by that name. Catalog names must be unique throughout the Product Catalog System. |
E_CAT_PRODID_DOESNT_EXIST | 0x88980010 | The property you specified for the ProductID did not exist in the Product Catalog System properties. |
E_CAT_UPDATE_FREETEXT_INDEX_FAILED | 0x88980015 | This error occurs when full text search is installed but updating the full text search index fails.
The catalog is created but full text search does not work. For the catalog to participate in full text searches delete the catalog and recreate it. |
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 ppNewCatalog parameter contains valid data only if the method completes successfully.
If variants are to be used in this catalog, you must provide a property name in the optional strProductVariantID parameter. If this parameter is not specified upon creation of the catalog, any attempt to create a product variant in that catalog will fail.
If the strProductID or strProductVariantID parameters are of type cscString, cscEnumeration, or cscFileName, they are limited to a length of 256 characters.
The returned ProductCatalog object will be pre-initialized and ready for use.
Notes
This method cannot be called in a transacted object. This method involves the creation, deletion, or updating of free text indexes. SQL Server does not allow these operations in a transaction.
Catalog names, and therefore the strCatalogName, parameter cannot begin with the pound sign (#) and cannot contain any of the following characters:
Blank space ( )
Double quote (")
Comma (,)
Period (.)
Left square bracket ([)
Right square bracket (])
For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.