I am working with Pervasive 2000i. I'm using client Interface Engine to connect to server.I want to lock a record if one of the users is busy working with it. When 2nd users edit client he should not be able to edit client.
My idea was to use the DtoSqlClient collection that you can use to connect to server. I want to use a txt file to list all active users while users are logged on and with what client it is busy with. As soon as comp freezes or he logs out - Conn will not be active anymore and user will be deleted from txt file and client is available for next user to edit.
Timer will refresh active users keep txt file updated
When you use ODBC Engine Interface you are able to see active users but not with ODBC Client Engine.
1. Is this a good way to test for active users with a record or are there any other ways to see what users are using what records.
An easy way is to open the recordset exclusively and keep it open - this is a bad idea.
A better (but a bit more code of course) would be to implement the locking in the application itself. Use a flag to indicate if that "part" of the data is "in use" by another user and prevent another client from accessing it. You could then offer to "override lock, etc.." if need-be.