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
 
 
À
10/06/2003 10:57:56
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00798363
Message ID:
00798413
Vues:
32
I like this better (VFP8)
TRY
	USE mytable EXCL
CATCH TO oErr WHERE oErr.ErrorNo = 1705
	* Table is in use by someone else
ENDTRY

IF USED("mytable")		&& table is open exclusevly, proceed
	* Do whatever
ENDIF
>Adjusted to restore previous ON ERROR setting...
>
>>
>>I think it is easier to check "after you open it", that is, use error handling. For instance:
>>
>>
>>local llFileError, lcOldError
>lcOldError = on("error")
>>ON ERROR llFileError = .T.
>>use MyTable
>>ON ERROR &lcOldError
>>if llFileError
>>  MessageBox("Can't open table.")
>>else
>>  (Continue processing)
>>endif
>>
>>
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform