Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get SQL results containing only Locked Records?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00201123
Message ID:
00201852
Views:
10
I've worked with semaphore locks before and it just seems like a little overkill (and too much clean) up to mess with in this situation.

Anyway, here's what I came up with to get the list of currently logged in users, er locked records. It seems to work well.

Thanks for the help everyone!

*-----------------------------------------------------------------------------
*--Gathers All Records Locked by this or any other workstation.
*-----------------------------------------------------------------------------
lnWasSel = SELECT()
lnWasReProc = SET('REPROCESS')
SET REPROCESS TO 1

SELECT * FROM DBF() WHERE l_IsLocked() ;
INTO CURSOR c_AllLocks

SELE (lnWasSel)
SET REPROCESS TO (lnWasReProc)

*-----------------------------------------------------------------------------
*--Determines whether a record is locked by us or any other user.
*-----------------------------------------------------------------------------
FUNCTION l_IsLocked()
*
llRetVal = .T.
IF ! ISRLOCKED()
IF RLOCK()
UNLOCK RECORD RECNO()
llRetVal = .F.
ENDIF
ENDIF
RETURN llRetVal
Previous
Reply
Map
View

Click here to load this message in the networking platform