[RESOLVED] Record Locking in tables dao/ado
Greetings to All,
This is a call from belgium, could you help me?
My problem is very simple, hope that the solution will be
the same :-).
My database is stored on a NT server with 3 workstations.
All the users have access to the database.
Oke, thats no problem, but how can I lock the record
when a user accessed it?
In DAO the locking works but the whole table has been locked instead of that specific record.
I changed the project in ADO with adLockPessimistic and
it's not working, everybody can change the same record.
Is there someone familiar with multi-user programming and
could tell me how it works?
Perhaps a small piece of test code should help me a lot.
I'm using MS Access 2000, Visual Basic 6 Pro, no datacontrols on the form and running MDAC 2.5.
I'm using SQL to access the tables.
Thank you for your time.
Re: Record Locking in tables dao/ado
Maybe someone could help me out....
The RecordLocks property of my form is set to "Edited Record".
A user creates a new record and starts filling info in the form. This works good.
Meanwhile, another user goes to that record and tries to update data, but end up with an error because the record is locked. This works good.
My concern:
I'd like the 2nd user to be warned that he won't be able to edit that record. In some case, I will even completely DENY access to that record. How could I see if the current record is locked? If I'd knew how to do this, I would then be able to DISABLE some buttons on the form to avoid the 2nd user adding sub-records (invoices, notes, product order details etc)
Thanks
Re: Record Locking in tables dao/ado
Please try DAO data control instead of using dao code.
It works fine.
regards.