Locking a single record using ADO 2.0, VB6 and JET 4.0 Provider

Hi there,
Is it possible to lock a single record using ADO 2.0 in MSAccess 2000 from VB 6.0. I have got a situtation where I have to lock a single record exclusively for a very brief period.
If not then how can I open the table in exclusive mode ? I have tried various combination of Lock and cursor type but none seem to work.
Thanks in advance
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I dont think Access supports record level locking.

However, u can open a recordset using Pessimistic locking which will lock the record/page for the time u r editing the record.


rs.Open "SELECT * FROM <> WHERE <>", cn, adOpenDynamic, adLockPessimistic

Pessimistic locking, record by record — the provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source as soon as you start editing records. No other users can read or edit the data until you either save changes with the Update method or cancel them with the CancelUpdate method.

Hope this helps

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
paraskafleyAuthor Commented:
That I knew, I was hoping to find out whether access supported true record level lock or not as I read somewhere that JET 4.0 does support it. Maybe I am wrong.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.