AdminSite.Create

Ee824434.c++_on(en-US,CS.10).gifEe824434.vb_off(en-US,CS.10).gif

Use this method to create a Site Server 3.0 Commerce Edition site and to optionally create an application and the Config\SQL\SqlSvr and Config\SQL\Oracle subdirectories.

Definition

Sub Create(bstrInstance As String,bstrVDir As String,bstrDir As String,nAuthorization As Long,bIsApplication As Boolean,bIsCommerceSite As Boolean)

Parameters

bstrInstance

A numeric value expressed as a String representing a Web site. For the default Web site, use (1).

bstrVDir

A String that contains the Site Server 3.0 Commerce Edition site short name (virtual directory).

bstrDir

A String that specifies the physical directory in which to create the site.

nAuthorization

A Long that contains site authorization type.

bIsApplication

A Boolean that controls whether an application is created for the site. If set to True, an application is created for the site. Otherwise no application is created. This setting must be True for a Site Server 3.0 Commerce Edition site.

bIsCommerceSite

A Boolean that controls whether SQL Server and Oracle subdirectories are created for the site. When set to True, the method marks the site for administration by Site Server 3.0 Commerce Edition and creates the Directory\Config\SQL\SqlSvr and Directory\Config\SQL\Oracle subdirectories (where Directory is the value passed in the bstrDir parameter). When set to False, the method creates the top level Directory directory only.

Return Values

None.

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

An AdminSite object must be initialized before most of its other methods can be called (the Create and IsValidName methods are exceptions). An object that has been created by the Create method of the AdminSite object is automatically initialized and does not need an explicit call to its Initialize method.

The valid characters and length for a Web site name are determined by the restrictions on the names of Microsoft SQL Server tables. In addition, a short name must not conflict with another short name on the server.

Before you actually create a site, use the IsValidName method to ensure that the short name of the site is valid. The name must conform to several rules for forming valid names in many environments. For example, Commerce Server appends the short name of a site to database tables and to generated pages.

Example

' oAdminSite is a Commerce.AdminSite object
' The szSite argument contains the site short name,
'  and szSiteRoot contains the physical directory.
AdminSite.Create ("1", szSite, NULL, szSiteRoot, true, true)

See Also

AdminSite Object

AdminSite.Delete

AdminSite:Initialize

AdminSite.IsValidName


All rights reserved.