I'm developing an application that runs from a shared folder. In the same folder is the Access database. To avoid conflicts in Access, it will only be allowed to be run by only one user at a time, so two users on different machines are not allowed to run the application at the same time.
I thought of a Lusitanian method, creating a temporary file every 5 min, containing the current date and time. Where, if another user tries to run the application and this file exists in the folder, its access is not allowed. And, if there is a bug in the first instance execution and the file remains in the folder, if it was created more than 5 minutes ago, a new access is allowed.
Is there a more 'elegant' method for this type of control?