Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get SQL results containing only Locked Records?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00201123
Message ID:
00201852
Vues:
12
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform