Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check to see if a table on a network drive is in use
Message
From
10/06/2003 10:30:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
10/06/2003 10:19:57
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00798363
Message ID:
00798375
Views:
27
>I need to get exclusive access on a table in my code, but sometimes other users may have this table open. Is there a way I can display in a messagebox which user has the table open, so the person running the app can get them to close out of it?

I found it difficult to determine individual users. What I ended up doing, for maintenance purposes, is the following:

Usually, I do maintenance tasks, that require exclusive access, at midnight, through Scheduled Tasks.

For emergencies, I have the executable check every two minutes (through a Timer, of course) for the existence of a file with a special name, "maintenance.tmp". If this file exists, the application issues the OnQuit() method of the application object. Also, on startup, the application will check for this special file, and close with an error message if the file exists.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform