Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application control
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00067911
Message ID:
00067981
Views:
24
>Is there a way to only allow one instance of an application to be executed on a workstation. I'm using a table right now that holds user information and if the user is logged on, I populate a logical field to .T., but this has obvious problems when users don't escape the application in a normal fashion, or the computer crashes leaving the field still reporting a .T. value. Thanks!
John,

How about locking the record as well as setting the flag. The record lock will be lost if the user leaves the app or shuts down the computer. This means your logic at start up would be ;

1) look for a record for this user
Exists) if found try see if it is locked with ISRLOCKED()
Is locked) if it is locked this user is already logged in from this station
Is not locked) if it is not locked, try to lock it with and RLOCK()
Got the lock) if you can lock it then the user record is old and not valid, let them in
Did not get the lock) if you cannot lock it then the user is logged into the app from another station
Does not exist) if there is no record then let them in
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform