Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File is in use
Message
De
04/04/2006 11:33:21
 
 
À
04/04/2006 05:35:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 6
Divers
Thread ID:
01110182
Message ID:
01110293
Vues:
24
Replace ALL this with these two lines
use ftap exclusive
zap


Actually, it requires a little more code. We need to add some error trapping because if the file is already open in another data session, she will not be able to get exclusive use of it:
LOCAL lcOldOnError, llError
llError = .F.
lcOldOnError = ON( [ERROR] )
ON ERROR llError = .T.
use ftap exclusive IN 0  
IF llError
  *** can't get exclusive use
  MESSAGEBOX( [Unable to get exclusive use], 16 )
ELSE
  ZAP IN fTap
ENDIF
IF NOT EMPTY( lcOldOnError )
  ON ERROR &lcOldOnError 
ELSE
  ON ERROR
ENDIF

RETURN ( NOT llError )
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform