Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting when user exits a VFP .exe improperly
Message
From
25/11/1996 15:01:02
 
 
To
25/11/1996 07:07:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00013353
Message ID:
00013436
Views:
30
>I need some way to find out when a network (esp. Win95, NetBeui) user of my VFP .exe dose not exit properly (power-outage, GP fault, etc.) so that I know the next time another user logs on to "clean-up the tables" (pack/reindex/append to new structure).
>
>Anybody got any ideas? Note: you can't rely on the lock status of a record because a Win95 "server", as opposed to NT, does not automatically dissconnet a user/client with open files when that user crashes.

Jim,

Unless I'm missing something, I can see a couple of flaws with the other responses. Here's a method that works flawlessly:

When a user logs into the system, create a text file on the server with FCREATE() and leave the file open the whole time the user is in the system. Record the filename in a DBF. Of course, delete the file and remove the file name from the DBF when the user logs out.

When the next user logs in, SCAN the DBF and try to FOPEN() each file that is there. If you can FOPEN() the file, the user logged out improperly. If you cannot FOPEN() the file, the user is still in the system. If the user terminated the application improperly, erase the file and blank the field in the DBF.

This method also works to limit the number of simultaneous users.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Previous
Reply
Map
View

Click here to load this message in the networking platform