Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record Locking with Local/Remote Data
Message
From
06/12/1998 08:13:26
 
 
To
30/11/1998 18:06:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00162588
Message ID:
00164521
Views:
24
I had the same problem, and used the following solution.

I created a table with one record. In the init event of your form, simply attempt to lock this one record from the table. If you are successful, then the user can continue with the form. If not, simply release the form with a message saying that this form is being used by another. This one record could store the name of the person that is currently using the form, so at least all subsequent users know who to contact if they wish to complain !!!!

I found this to be far simpler than using semaphore locking, or using flag files. If there is an abnormal termination, then the lock will automatically be released anyway. You could also use a timer event on the form to check for inactivity, or perhaps have a maximum amount of time that one user can monopolise the form.

Derek
Previous
Reply
Map
View

Click here to load this message in the networking platform