AdminWebServer.GetCommerceSites

Ee785325.c++_on(en-US,CS.10).gifEe785325.vb_off(en-US,CS.10).gif

Use this method to enumerate all Commerce Server sites associated with the specified Web site. The method returns an array of numbers that represents all Commerce Server site instances.

This method does not work with Commerce Server 2000 sites. It is included only for backward compatibility with Site Server 3.0 Commerce Edition sites.

Definition

Function GetCommerceSites(bstrInstance As String) As Variant

Parameters

bstrInstance

A numeric value, expressed as a String, that represents a server instance for a site.

Return Values

This method returns a Variant that contains an array of numbers that represent all Commerce Server site instances.

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 GetCommerceSites method determines whether a site is a Commerce Server site by examining a reserved key in the metabase.

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

Example

' oAdminWebServer is a Commerce.AdminWebServer object
' The following example enumerates all the Web sites on a server and 
' displays the number of each server instance. Then for each Web site, it 
' enumerates all the Commerce Server sites within that Web site:
' Create AdminWebServer object
Set objWebServer = CreateObject("Commerce.AdminWebserver")
' Get Web sites
WebSites = objWebServer.GetWebSites
For WebInstance = LBound(WebSites, 1) To UBound(WebSites, 1)
   ' For each web site, get all Commerce sites in an array of instances
        CommerceSites = objWebServer.GetCommerceSites(WebSites(WebInstance))
   ' Enumerate all Commerce sites
      For CSite = LBound(CommerceSites, 1) To UBound(CommerceSites, 1)
         Response.Write "<br>" + CommerceSites(CSite)
      Next
 Next

See Also

AdminWebServer Object


All rights reserved.