>>Like most of us, I'm sure, we have times when we need to lock a large number of records at one time. In this case we need to mark over 100 records before batching them.
>>
>>On a whim we just tried this SQL statement and darned if it didn't work. This is all VFP 9 by the way, both code and .DBF.
>>
>>My question is this, has anyone else used this (I have never seen it before) and what what are the odds that it can always be relied on to work? It just seems to be too easy.
>>
>>
SET MULTILOCKS ON
>>
>>select k_arinvc, rlock('arinvc') as lockok ;
>>from arinvc ;
>>where duedt > {^2007-02-01} ;
>>into cursor c_locks
>>
>>brow
>
>Hi,
>Do you intend waiting indefinitely for a lock. If not then what do you do about rows where 'lockok' is .F.?
>Regards,
>Viv
Viv,
we would handle any records that did not get locked in the normal manner. That is, give the user a message that some recs are in use right now and try again later. Any way we do this the recs need to be locked before that batch update.
Update: I was assuming a setting of:
SET REPROCESS TO 1
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn