Sure. Use an application variable.
Code:
if Application("FILELOCKED")<>"true" then
Application("FILELOCKED")="true"
'do stuff with the file
Application("FILELOCKED")="false"
end if
To make it wait for the lock, instead of IF...THEN, use DO...LOOP.
If you're going to have a lot of connections to your site, you need to make sure two people don't execute the filelock check at the same time, because both would show it was unlocked then both would try to lock it. To do that, you'll have to use Application.Lock.More Information:
- write permissions to the folder where the Access file is located
- Allows you to add/delete/edit entries and includes column sorting, automatic links, and a file lock for
- When SQLite tries to access a file that is locked by another process, the default behavior is to return SQLITE_BUSY
- Add: An option "Generate a standalone login file for each locked HTML file" in Step 3, Advanced Options dialog
- Visit Dev Articles to discuss How to prevent ldb lock files
Bookmarks