Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for Exclusive Open?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00741115
Message ID:
00741187
Vues:
24
This is not reliable. Between the FCLOSE() and a USE, someone else could get the table. The ONLY reliable way is to attempt to USE EXCLUSIVE and traps for the error if it can't be opened.

>Hi marvin
>I have a function that handles that you could try this:
>
>FUNCTION EXCL_USED
>* SEE IF YOU CAN GET EXCLUSIVE ACCESS TO THE FILE
>
>LPARAMETERS file_name
>
>temp_handle=FOPEN(file_name+'.dbf',2)
>DO CASE
>	CASE temp_handle=-1
>		RETURN .F.
>	OTHERWISE
>		FCLOSE(temp_handle)
>		RETURN .T.
>ENDCASE
>
>hth
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform