>Hello Edward,
>
>>>We have SET EXCLUSIVE OFF and also open the tables with USE TABEL SHARED.
>
>>RLOCK() should work the same way for both free and non-free tables. Try to check your code, maybe it's something wrong there.
>
>You are correct. There was a error in the code. But we still have the problem. We have RLOCK()ed a record in a table (we use this on the USERS table so that we can know if the user is logged on or not). Then we USE the same table in another form which is Optimistic Table Buffered by another user (still with me :-)).
>
>We change the record which is RLOCK()ed with the other user. It just works without any errors (TABLEUPDATE(.T.) doesn't give a lock error). Then we logoff and logon anew. Then we edit the record again and we see that nothing has changed.
>
>Now the question. How do we get a error message with TABLEUPDATE() that the record is locked and can't be changed?
>
>I hope you understand my 'story' :-)).
>
>Thanks!
You should not get errors if the record truely is RLOCKED(). I suggest you test things in the command window and see what your results are.
As for checking if a user is logged on, there is an article on my web page that discusses limiting simultaneous logins. The same method can be used to check if a particular user is logged in.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer