Microsoft KB Archive/154532

= How Dependent Is Commerce on Physical Location of Store Files? =

Article ID: 154532

Article Last Modified on 9/30/2003

-

APPLIES TO


 * Microsoft Commerce Server 2.0

-



This article was previously published under Q154532



SUMMARY
Q. How dependent is Commerce Server on the physical location of the store files? Can I import them to a Web site project using Visual Interdev?

A. Only the Commerce Server Host Administrator and the Store Administration objects depend on the store being in the Commerce Server directory structure. You can move the files to another directory to use with Visual Interdev. After you have done this, you need to correct the Internet Information Server (IIS) virtual roots related to the store (that is, the store, store_mgr, and store_assets virtual roots) to point to the new directory. You also need to edit the store's Shop\Global.asa and Manager\Default.asp to correct the path of the Pipeline.pcf file.



MORE INFORMATION
If you move the files to another directory, the store will no longer be listed in the Commerce Server Host Administrator, and the store's management page will no longer be able to list the status (open or closed) of a store or change that status. You can fix the latter by changing the VBScript code used for this and replace it with your own code that determines which Global.asa file is in use (the store open Global.asa or the store closed Global.asa), and switch between the two Global.asa files.

You must create some sort of a file object and query for Global_opened.asa or Global_closed.asa files in your store's shop directory. If Global_closed.asa is found, the store is open, and vice-versa. When the administrator clicks the Close Store button, you need to rename the Global.asa file to Global_opened.asa and Global_closed.asa to Global.asa. Conversely, when the administrator clicks the Open Store button, you must rename the Global.asa to Global_closed.asa and Global_opened.asa to Global.asa. Below is a code example that switches the Global_*.asa files depending on the current store status. You may need to modify the example to suit your directory structure.

In Default.ASP Under \Manager
Dim boolRet set TempFileObj = Server.CreateObject("Commerce.AdminFiles") boolRet = TempFileObj.Exists("C:\inetpub\wwwroot\MSCSTestVI\global_closed.asa") if boolRet = TRUE then status = "Open" RevStatus = "Close" else status = "Closed" RevStatus = "Open" End if

<%        REM -- open/close button if status <> "Invalid" then %>           "> "> ">  Store">  <% else %> *****        <% end if %>

In Xt_Change_Status.ASP Under \Manager
set objAdmin = Server.CreateObject("Commerce.AdminFiles") If Request.Form("Status")= "Open" then call objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global.asa", "C:\inetpub\wwwroot\MSCSTestVI\global_opened.asa") call objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global_closed.asa", "C:\inetpub\wwwroot\MSCSTestVI\global.asa") call objAdmin.Touch("C:\inetpub\wwwroot\MSCSTestVI\global.asa") Else call objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global.asa", "C:\inetpub\wwwroot\MSCSTestVI\global_closed.asa") call objAdmin.Rename("C:\inetpub\wwwroot\MSCSTestVI\global_opened.asa", "C:\inetpub\wwwroot\MSCSTestVI\global.asa") call objAdmin.Touch("C:\inetpub\wwwroot\MSCSTestVI\global.asa") End IF A tighter integration between Commerce Server and Visual Interdev will be considered for a future release.

Additional query words: kbfaq VI VID

Keywords: kbinfo kbinterop kbfaq KB154532

-

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

© Microsoft Corporation. All rights reserved.