Share via


CatalogManager.CreateCatalog

Ee799013.c++_on(en-US,CS.10).gifEe799013.vb_off(en-US,CS.10).gif

Use this method to create a new catalog.

Definition

Function CreateCatalog(strCatalogName As String,strProductID As String,Optional strProductVariantID As Variant,Optional lcidLocale As Variant,Optional strCurrency As Variant,Optional strWeightMeasure As Variant,Optional dtStartDate As Variant,Optional dtEndDate As Variant) As ProductCatalog

Parameters

strCatalogName

A String that contains the name of the catalog to be created. See the Remarks section for a list of restricted characters.

strProductID

A String that contains the product ID property.

strProductVariantID

A Variant that contains the product variant ID property.

lcidLocale

A Variant that contains the locale ID (LCID) of the catalog to be created.

strCurrency

A Variant that contains the currency type of the catalog to be created.

strWeightMeasure

A Variant that contains the unit of weight or measure of the catalog to be created.

dtStartDate

A Variant of subtype DATE that contains the start date.

dtEndDate

A Variant of subtype DATE that contains the end date.

Return Values

If this method completes successfully, it returns the ProductCatalog object that was created.

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
E_CAT_CATALOG_EXISTS &H88980001 There was already a catalog by that name. Catalog names must be unique throughout the Product Catalog System.
E_CAT_PRODID_DOESNT_EXIST &H88980010 The property you specified for the ProductID did not exist in the Product Catalog System properties.
E_CAT_UPDATE_FREETEXT_INDEX_FAILED &H88980015 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. In particular, the Description property may contain a text description of the error.

Remarks

The ProductCatalog returned by this method is valid only if it was created 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.

Ee799013.note(en-US,CS.10).gifNotes

  • 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.

Example

Set oNewCatalog = myCatalogManager.CreateCatalog ("NewCatalog", "ItemNum", "SKU")

See Also

CatalogManager Object

CatalogManager.DeleteCatalog

CatalogManager.GetCatalog


All rights reserved.