AdminSite.InitializeFromMDPath
Use this method to initialize the AdminSite object from a specified Internet Information Services (IIS) metabase path. The metabase path can be retrieved using a call to the Request.ServerVariables method.
Definition
Sub InitializeFromMDPath(bstrMDPath As String)
Parameters
bstrMDPath
A String that contains the metabase path. The metabase path can be retrieved using a call to the Request.ServerVariables method.
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
Unlike the Initialize method, which requires that a server instance and virtual directory be specified separately, this method requires a metabase path to be specified.
Example
' The following example initializes an AdminSite object
' for the application's metabase path:
' oAdmSite is a Commerce.AdminSite object
' The szSite argument contains the site short name,
' and szSiteRoot contains the physical directory.
AdminSite.Create ("1", szSite, szSiteRoot, true, true)
Call oAdmSite.InitializeFromMDPath(Request.ServerVariables("APPL_MD_Path"))
' The Request.ServerVariables("APPL_MD_Path") expression returns
' the metabase path in the form /LM/W3SVC/1/mySite , where
' LM refers to the Local Machine, W3SVC refers to the
' Internet Service, 1 is the server instance, and mySite is the
' root of the Web site. This method works only if the application
' is created at the virtual directory (not a sub-directory).