Share via


IAdminSite::IsValidName

Ee797761.c++_off(en-US,CS.10).gifEe797761.vb_on(en-US,CS.10).gif

Use this method to determine the validity of a site name. The IsValidName method returns a value of True if the specified Site Server 3.0 Commerce Edition site short name is valid, and False otherwise.

Definition

HRESULT IAdminSite::IsValidName(BSTRbstrName,BSTRbstrInstance,VARIANT_BOOL*pbRet);

Parameters

bstrName

[in] A BSTR that specifies the short name to be tested.

bstrInstance

[in] A BSTR that specifies the Web server instance. To obtain a list of server instances, use the GetWebSites method. For the default Web site, use "1".

pbRet

[out] The address of a VARIANT_BOOL used to return an indication of whether or not the site name is valid.

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

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 any other short name on the server.

The pbRet parameter contains valid data only if the method returns successfully.

Before you actually create a site, use this 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.

The IsValidName method of an object can be called without calling the Initialize or Create methods of the object.

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

See Also

AdminSite Object

IAdminSite::Initialize


All rights reserved.