ASP locking XML files.

admin

Administrator
Staff member
I am having a problem regarding ASP locking XML files.When a user first enters the application the XML files get deleted andrefreshed properly. The HTML is served to the client without a hitch.The problem comes when the user wants to refresh the page with currentinformation. The user presses a link that in turn runs the the ASPpage that deletes the xml files (if they exist) and replaces them with freshcopies. The files are not getting refreshed.The code for this is a follows:strSQL = "usp_sel_SomeStoredProcedure"set rs = cn.execute(strSQL)filespec = "C:\SomePath\Client.xml"If (fsoObject.FileExists(filespec)) Thenset filObject = fsoObject.GetFile(filespec)filObject.Delete trueEnd If'Line 49rs.Save filespec,adPersistXMLWhen the user refreshes the page I get this error:Provider error '80070005'Access is denied./SomePath/Data.asp, line 49If the page is run properly, it calls a second ASP page that creates thehtml to sent ot the client.In this second page I reference the XML with the following code.<XML ID="ClientDoc" SRC=http://forums.devx.com/archive/index.php/"./Client.xml" ></XML>Even though the error is occuring on the first page I believe the sourceof the error is on the second page.This is what I believe is happening:When the application first loads the xml file is deleted andre-created because there is no file lock on it.When the second page runs, the xml file is locked. The page isserved to the client. The xml file is not released.When the user hits the refresh link, the first page cannot recreatethe file because it is locked. It is not until the file isunlocked that any user can access the application again.I am pretty new to XML so I would like to know how to handle thissituation. I want to know if there is a way to unlockthe xml file on the server after it served the second page to a client.In my application, there is no reason to have the xml filelocked after it has been sent to the client. If you have a bettersolution for my application those comment would also be appreciated.
 
Back
Top