Microsoft KB Archive/277045

= GlobalConfig.DeleteSiteConfig: Cannot Delete Site When Resources Exist =

Article ID: 277045

Article Last Modified on 10/22/2003

-

APPLIES TO


 * Microsoft Commerce Server 2002 Standard Edition
 * Microsoft Commerce Server 2000 Standard Edition

-



This article was previously published under Q277045



SYMPTOMS
If you use the Globalconfig object programmatically, and you delete a Web site that has resources by using the globalconfig.deletesiteconfig method, you may receive one of the following error messages:

Run-time error -2147467259(80004005)

Cannot Delete Site with resources

MSCSGroupConfigAdmin.cls:DeleteSiteConfig,

In an ADSite:

Automation Error: The directory service can perform the requested operation only on a leaf object.



CAUSE
Typically, only the Commerce Site Packager or the Microsoft Management Console (MMC) uses the DeleteSiteConfig method. Also, the program that uses the DeleteSiteConfig method is expected to delete all resources before calling this method.



Steps to Reproduce the Behavior
 Unpack the Retail Site. In a Visual Basic EXE, add a reference to the Microsoft Commerce Server configuration type library.  Run the following code: Dim globalconfig As New globalconfig globalconfig.initialize &quot;&quot; globalconfig.DeleteSiteConfig &quot;retail&quot; 

To successfully delete the Retail Site, you must first delete all resources in the site. For example, the following code successfully removes the site without error: Dim globalconfig As New globalconfig Dim siteconfig As New siteconfig

siteconfig.Initialize (&quot;retail&quot;) globalconfig.Initialize &quot;&quot;

Set Fields = siteconfig.Fields

For Each field In Fields If field.Attributes = 8208 Then resource = field.Name siteconfig.DeleteComponentConfig resource End If Next

globalconfig.DeleteSiteConfig &quot;retail&quot;

Additional query words: plutonium

Keywords: kbprb kbpending KB277045

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.