Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP 3.0 - Determing Usage of Opened Database
Message
From
16/04/1997 23:51:45
Larry Long
ProgRes (Programming Resources)
Georgia, United States
 
 
To
16/04/1997 12:21:55
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00028557
Message ID:
00028658
Views:
53
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform