>>>Hi all,
>>>
>>>I guess it's not possible for VFP to tell you who locked a particular record (or a table, whatever)? The rlock() function doesn't return this information when you try to place a lock on a record, which is already locked by some other user.
>>>
>>>Best regards,
>>>Abe
>>
>>You may provide on application level, i.e. you can add one more field to a >table which will be filled by e.g. UserId when successful RLOCK() is applied, >i.e. next user can read UserId after unsuccessful RLOCK().
>
>If User1 rlock the record, write UserId1 and after this, for example, go frozen? This record remain locked. Who it unlocked? Only User1? And what about User1 will go to your holiday? Which metod is correct to unlock bad locked records?
>
>Maros Klempa
When user finishes editing, s/he fires UNLOCK and the record gets unlocked. If s/he just turn computer off (going for holiday, as you stated) then all locks are released. If you mean situation when someone takes yearly leave without turning off his/her workstation, then you may build a timer which will unlock record after some amount of time elapsed. BTW, it's not the best design (in most cases) to apply any pessimistic lock.
Edward Pikman
Independent Consultant