Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If file is used by another exclusively
Message
 
À
13/11/2008 21:12:33
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01361833
Message ID:
01361872
Vues:
18
Randy,

I know of no way you can find out if the other user has the file exclusively, but you can find out inf anyone else has the file open;
* Save error handler
lcOnError = ON("ERROR")

* Set on error to find out if you get the file open
ON ERROR llError = .t.
llError = .f.

* Attempt to use the file exclusively
USE TheTable EXCLUSIVE

* Restore the error handler
ON ERROR &lcOnError

IF llError
  * Someone else has it in use

ELSE
   * It is not in use by anyone else but is now yours exlcusively

ENDIF
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform