Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Testing for lock without locking
Message
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Title:
Testing for lock without locking
Environment versions
Visual FoxPro:
FoxPro Windows
Miscellaneous
Thread ID:
00960484
Message ID:
00960484
Views:
40
I'm real sure I know the answer to this, but I hope I'm wrong.

Is there any way to test a record to find out if it is NOT locked?
....without locking the record as a result/consequence of the test...

In the past I've always tested to see if I could get a lock... like this...
IF RLOCK()
 *locked achieved
ELSE
 *could not lock - implies that someone else has the record locked
ENDIF
But what I need is to know if someone else has the lock...
I suppose I could do something like this...
IF RLOCK()
 *locked achieved
 UNLOCK
ELSE
 *could not lock - implies that someone else has the record locked
ENDIF
...but that seems wrong and if the timing is just so, could leave me with the same problem I'm tryin to address...
The problem I'm trying to address is that I have a user who created a record
(the record was created with an Append Blank)
edited the record in one of my screens and clicked the OK button...
The Code in the OK button failed on a GATHER statement with the message
"Record is in use by another."
How is that possible????
And more importantly... What can I do about it????


TIA,
Rick Liebespach
Next
Reply
Map
View

Click here to load this message in the networking platform