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
Paras
paraskafleyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
agarwal_rahulConnect With a Mentor Commented:
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.

e.g

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
Rahul
0
 
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.
0
All Courses

From novice to tech pro — start learning today.