Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there a way to count locked records?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00061540
Message ID:
00061550
Vues:
36
>>I know we can lock, unlock, set multiple locks, and so on, now, can we actually count how many records are locked in a networked table? If I were to issue a command such as COUNT TO N FOR RLOCK() = .F. woudn't I be locking records as I'm counting?, it would make sense to me...then what would be the proper way to do this?
>>
>>Thanks, ladies and gentlemen...
>
>Gilberto, could you use Sys(2011)? It will give you the information you want, but I can't think how to use it except by checking every record....
>
>Barbara

Barbara, I just tried using sys(2011) like this:

USE CUSTOMERS &&with 150,000 records
SET multilocks on
GOTO 1200
=rlock()
GOTO 10000
=rlock()
GO top

DO while .t.
lcVar = sys(2011)
IF upper(lcVar) = 'RECORD LOCKED'
WAIT WINDOW 'Found one, continue: ' to cValue
IF upper(cValue) = 'N'
RETURN .f.
ENDIF
ENDIF
Skip
ENDDO
CLOSE all

and yes, it takes too much time, so if you find or hear a different way please let me know.

Thanks,
For every bug fixed, there is a bigger bug not yet discovered.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform