Share via


IAdminSite::Create

Ee810025.c++_off(en-US,CS.10).gifEe810025.vb_on(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

HRESULT IAdminSite::Create(BSTRbstrInstance,BSTRbstrVDir,BSTRbstrDir,longnAuthorization,VARIANT_BOOLbIsApplication,VARIANT_BOOLbIsCommerceSite);

Parameters

bstrInstance

[in] A numeric value expressed as a BSTR representing a Web site. For the default Web site, use (1).

bstrVDir

[in] A BSTR that contains the Site Server 3.0 Commerce Edition site short name (virtual directory).

bstrDir

[in] A BSTR that specifies the physical directory in which to create the site.

nAuthorization

[in] A long that contains the authorization type.

bIsApplication

[in] A VARIANT_BOOL 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

[in] A VARIANT_BOOL 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

This method returns an HRESULT indicating whether or not it completed successfully. See the Error Values section for more details.

Error Values

This method returns S_OK (0x00000000) to indicate success and standard COM HRESULT 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, which can be accessed using the API function GetErrorInfo. In particular, the GetDescription method of the IErrorInfo interface may return 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.

See Also

AdminSite Object

IAdminSite::Delete

IAdminSite::Initialize

IAdminSite::IsValidName


All rights reserved.