Code to Find the Available Catalogs

The names and attributes of the catalogs in the Product Catalog System are available in a recordset returned by the Catalog property of the CatalogManager object. The following example creates a recordset of the available catalogs and prints out a list of the catalog names in a particular language:

Dim oCatMgr
Dim rsCatalogs
' Get a local reference to the CatalogManager
' object created in the Global.asa file.
Set oCatMgr = Application("MSCSCatalogManager")

‘ Get the list of catalogs which have a en-us DisplayName. 
Set rsCatalogs = oCatMgr.Catalogs( "Not((DisplayName IS NULL) or ( DisplayName = '' ))"  , , , "en-us")

'Write out the catalog names from the recordset.
If (rsCatalogs.RecordCount > 0) Then
    rsCatalogs.MoveFirst()
    Do While Not rsCatalogs.EOF
        Response.Write rsCatalogs.Fields("DisplayName").Value
        Response.Write "<BR>"
        rsCatalogs.MoveNext()
    Loop
End If

Copyright © 2005 Microsoft Corporation.
All rights reserved.