AdminSite.IsValidName

Ee824013.c++_on(en-US,CS.10).gifEe824013.vb_off(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

Function IsValidName(bstrName As String,bstrInstance As String) As Boolean

Parameters

bstrName

A String that specifies the short name to be tested.

bstrInstance

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

Return Values

If this method completes successfully, it returns a Boolean. A value of True indicates that the short site name is valid. A value of False indicates that the short site name is not valid.

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 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.

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.

Example

' oAdminSite is a Commerce.AdminSite object
' The szSite argument contains the site short name
' bResult is a Boolean
bResult = oAdminSite.IsValidName(szSite,"1") 

See Also

AdminSite Object

AdminSite.Initialize


All rights reserved.