Share via


CatalogSets.CreateCatalogSet

Ee823973.c++_on(en-US,CS.10).gifEe823973.vb_off(en-US,CS.10).gif

Use this method to create a new catalog set in the catalog database.

Definition

Function CreateCatalogSet(CatalogSetName As String,CatalogSetDescription As String,bWildCard As Boolean,Optional CatalogNamesRS As _Recordset) As String

Parameters

CatalogSetName

A String that contains a name for the new catalog set. The maximum length is 128 characters.

CatalogSetDescription

A String that contains a description of the new catalog set.

bWildCard

A Boolean that indicates whether this catalog set should automatically include all catalogs, including any new catalogs that might be created in the future. A value of True indicates that this catalog set includes all existing catalogs. A value of False indicates that this catalog set only includes a specific set of catalogs.

CatalogNamesRS

A reference to an ADO Recordset object that specifies the catalogs to be included in the new catalog set. The Recordset object should contain a single column named CatalogName, and one row per catalog to be included. If the bWildCard parameter is True, then this parameter will be ignored.

Return Values

If this method completes successfully, it returns a String that contains the ID of the new catalog set.

Error Values

This method sets the Number property of the global Err object to S_OK (&H00000000) to indicate success and to standard COM error values to indicate failure. For more information about standard COM errors, see Standard COM Errors. 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 returned String contains a valid ID only if the new catalog set was created successfully.

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

Example

'The following example shows the creation of a catalog set 
'associated with all the catalogs in the catalog management system.
strCatalogSetID = myCatalogSets.CreateCatalogSet("PremiumCatalogs", "Premium catalog set", TRUE)

'The following example shows the creation of a catalog set 
'associated with two specific catalogs.
set rsCatalogNames = CreateObject("ADODB Recordset")
call rsCatalogNames.Fields.Append("CatalogName", adBSTR)
rsCatalogNames.Open
rsCatalogNames.AddNew
rsCatalogNames.Fields("CatalogName").value = "Catalog1"
rsCatalogNames.Update
rsCatalogNames.AddNew
rsCatalogNames.Fields("CatalogName").value = "Catalog2"
rsCatalogNames.Update

strCatalogSetID = myCatalogSets.CreateCatalogSet("CombinedCatalog", "A one and a two", FALSE, rsCatalogNames)

See Also

CatalogSets Object


All rights reserved.