Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to know if a table is locked?
Message
From
24/01/2000 17:28:27
 
 
To
24/01/2000 17:00:33
Fausto Garcia
Independent Developer
Lima, Peru
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00321849
Message ID:
00321877
Views:
20
>Hi to all,
>
>Is there a way to know if a table is locked in the middle of a transaction before opening it?

There's no way to check the lock status of a VFP table if you haven't USEd it.

>I tried using flock() but this works only if the table is open. What about checking a table lock status if it is closed? Isn't there a function as "locked()"?
>

ISFLOCKED()and ISRLOCKED() only reflect whether you presently hold a lock on a given table or record in the table respectively, not whether you could be granted a lock on it. The LOCK concept with VFP operates on a Test and Set basis - you try to gain a lock, and either get it and have it confirmed, or fail to get it and get it denied. You can't check if something is available to lock before opening the resource or trying to gain the needed access.

FLOCK() is not the same thing as USE EXCLUSIVE - you may have a table opened and acquire an FLOCK()< but cannot perform the restricted set of operations that need EXCLUSIVE access to the file such as PACK. The idea of FLOCK() is that others can read but only you can write, while USE EXCLUSIVE says that only you may have any access at all to the file for the duration of its reference.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform