• Welcome to Valhalla Legends Archive.
 

Check if file is already open (ADODB.Recordset)

Started by Spht, March 16, 2007, 05:04 PM

Previous topic - Next topic

Spht

I have a web site that accesses an XML file each visit (and saves to it).  A problem that occurs sometimes is that the file can not be saved because it is being used (ie, two people visited site at same time), and it generates a script error.

How would I handle this situation?  I looked at the State property, but I don't think that'll tell me if another instance is accessing the file.

It would also be nice if there was a way to wait until the other instance is done accessing the file, and then save if possible.

Ersan

#1
Handle the error and keep running the query until it works...

These things should only take milliseconds to execute, otherwise you need to stop using flat file databases.