Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How detect locked record ? 2

Status
Not open for further replies.

parslej

Programmer
Nov 21, 2001
40
PL
I want detect if record is locked or not.
Is in VFP any function that return .t. if current record is locked or .f. if not ?

Or how can I detect it other way...

Thanx a lot!
 
There are 2 ways to interpret your question. You can only determine whether the record has been locked BY YOU. SYS(2011) will return one of the following:

"Record Unlocked" (You have not locked the record)
"Record Locked" (You have locked the record)
"Exclusive" (You have the table opened exclusively)
"File Locked" (You have locked the whole table)

The only way to determine if another user (or another instance of the program on the same computer) has locked the record is to try to lock it yourself and trap for failure.
 
HI
IF RLOCK()
** RLOCK() has returned true
** Record is now locked
** Record is available
** do your update
UNLOCK
ELSE
** RLOCK() has returned false
** Record is not available for locking
ENDIF

Note if SET REPROCESS TO AUTOMATIC locks the table indefinetely. Read help on SET REPROCESS command.
It is assumed the reprocess is set to 1 or some number or for few seconds..

Hope this helps :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
Thanx your both!

I found another function:
isRLOCKED() - apply to records
isFLOCKED() - apply to files

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top