Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for Exclusive Open?
Message
De
13/01/2003 14:49:23
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00741115
Message ID:
00741147
Vues:
24
Marvin,

Leroy's suggestion will work almost all the time, possibly even all of the time. But it does have a whole in it...someone could theoretically open the file in the short period of time between the function call and your attempt to USE the table.

The best method is to do what Garret has suggested. You can make a function that does this for you. Something like this:
lcOldError = on("error")
llOpenError = .f.
on error llOpenError = .t.
use table1.dbf exclusive in 0
on error &lcOldError
if !llOpenError
   * we opened the file exclusively
else
   * could not exclusively open file
endif
>What is the best way to check to see if a table can be open exclusively before opening it exclusively and getting an error?
>
>In this case I want to do an ocassional PACK if there are no other users using the database, but of course use summary excl produces an error if other users are using the db.
>
>Thanks!
Steve Gibson
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform