Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check to see if a table on a network drive is in use
Message
De
10/06/2003 10:30:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
10/06/2003 10:19:57
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00798363
Message ID:
00798375
Vues:
26
>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)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform