COUNT does indeed a Filelock, which has the effect that the result doesn't get changed in between the time it needs to traverse the table.
Thus if someone is just editing a record and altering your FOR field: what should COUNT (or CALC or SUM etc) take into account? That's why it's waiting until he's finished. Of course, for a perfect waiting experience, you should SET REPROCESS correctly.
A SQL COUNT just takes a snapshot of the buffered data before the edit.
wOOdy
-----Ursprüngliche Nachricht----- Von: ProFox profox-bounces@leafe.com Im Auftrag von MB Software Solutions, LLC Gesendet: Donnerstag, 22. Oktober 2020 21:24 An: ProFox Email List profox@leafe.com Betreff: COUNT FOR hangs on record locking, but SQL - SELECT COUNT(*) works with no issue. Why?
VFP9SP3
Why would a COUNT FOR hang ("Attempting to lock") whereas my easy workaround is SELECT COUNT(*) FROM SomeCursor WHERE <<yada yada yada>> ??
tia, --Mike
-- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
[excessive quoting removed by server]