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 13:54:58
 
 
To
25/11/1996 07:07:43
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00013353
Message ID:
00013420
Views:
28
>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.

Create a log table with 3 fields: UserID, LogIn(DateTimeStamp),
LogOut(DateTimeStamp). When the user logs in, open the table and detect
if it's a known user or the one that already used the system at least
once. If the user is new, - append blank and store his UserID and LogIn
dateTime stamp. If the user has used the system, - clear his LogOut field
and store current dateTime stamp. After that close the table. On exit
of any user fill in their LogOut field. In this situation if any record
doesn't have a LogOut stamp you know for sure that they didn't exit
properly. There will be very little concern over this log table and the
logging function to be for multi-user environment because you will open
it only for a split of a second and there will be a slim chance that
more than one user will be attempting to open it at the same time. If you
really want to know what files were open at the time of crash you can
expand the structure of this logging mechanism and create one or more
tables that will hold the file names with the DateTimeStamp as an index
field. Every time the user goes to any module you log his LogIn value
into that table(-s), and on exit you delete the corresponding records.
It worked perfectly for the local University master scheduling program,
and I was also logging all their actions performed on the data so that
there was a complete set of information (including time spent in each
table) for user activities. ...And it's also fun to write :)
Some things are better be left unknown...NOT!!!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform