Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP 3.0 - Determing Usage of Opened Database
Message
De
16/04/1997 23:51:45
Larry Long
ProgRes (Programming Resources)
Georgie, États-Unis
 
 
À
16/04/1997 12:21:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00028557
Message ID:
00028658
Vues:
56
>>Any ideas how to determine is a database in use is opened shared or exclusively?
>
>Cannot remind some direct way, but you could use DBSETPROP() trying to make some dummy change (e.g. change comment to some field). If DBC opened exclusively you will succeed, and set lExclusive=.t., if not you should be stopped by some error code. Trapping this error, you resolve the problem (lExclusive=.f.).

You could run a test procedure something like
******************************
proc test_busy
parameters dbfname

if used(dbfname)
sele (dbfname)
use
endif

store on('error') to last_proc
*assuming no other errors occur the only error will be if the file is busy
on error return
use (dbfname) exclu
on error &last_proc

store not used(dbfname) to is_open
return(is_open)
****************************
? TEST_BUSY('TESTDBF')
RETURNS .F. IF TESTDBF.DBF IS NOT IN USE, .T. OTHERWISE

Hope this helps
Larry
L.A.Long
ProgRes
lalong1@charter.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform