ASP locking XML files.
I am having a problem regarding ASP locking XML files.
When a user first enters the application the XML files get deleted and
refreshed properly. The HTML is served to the client without a hitch.
The problem comes when the user wants to refresh the page with current
information. The user presses a link that in turn runs the the ASP
page that deletes the xml files (if they exist) and replaces them with fresh
copies. 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)) Then
set filObject = fsoObject.GetFile(filespec)
When the user refreshes the page I get this error:
Provider error '80070005'
Access is denied.
/SomePath/Data.asp, line 49
If the page is run properly, it calls a second ASP page that creates the
html to sent ot the client.
In this second page I reference the XML with the following code.
<XML ID="ClientDoc" SRC="./Client.xml" >
Even though the error is occuring on the first page I believe the source
of the error is on the second page.
This is what I believe is happening:
When the application first loads the xml file is deleted and
re-created because there is no file lock on it.
When the second page runs, the xml file is locked. The page is
served to the client. The xml file is not released.
When the user hits the refresh link, the first page cannot recreate
the file because it is locked. It is not until the file is
unlocked that any user can access the application again.
I am pretty new to XML so I would like to know how to handle this
situation. I want to know if there is a way to unlock
the 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 file
locked after it has been sent to the client. If you have a better
solution for my application those comment would also be appreciated.
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center