Antonio,
I have created a table 'FILELOCK' in my SQL table, with a field 'table','table_id','user','pcname'.
When I want to lock a record, I write te table,record-ID, user and PC-name to that table. (I created a function SQLLock)
An other user that want to open the record check with a function SQLlock that the record is available.
If not, it returns FALSE, otherwhise is locks the record by writing the info to the table FILELOCK.
I use the info USER and PCNAME, so I can display the purson who have locked the record...
So my function SQLlock works the same as rlock()
If I want to unlock the record, I delete the record in FILELOCK.