Exclusive lock?

  • Thread starter Thread starter mscertified
  • Start date Start date
M

mscertified

I need some way to enforce an exclusive lock so I can perform an operation
with all other users locked out until I am done. How can I do this in VB with
Access?
Essentially what I need to do is:-
Test lock
If in place, wait until released by other user
Place lock
Perform operation (read then delete row from table)
Release lock
 
mscertified said:
I need some way to enforce an exclusive lock so I can perform an operation
with all other users locked out until I am done. How can I do this in VB with
Access?
Essentially what I need to do is:-
Test lock
If in place, wait until released by other user
Place lock
Perform operation (read then delete row from table)
Release lock


Do you want to lock the enire database? If so and you have
a separate mdb file, then you could use the OpenDatabase
method with the exclusive option.

Or do you want to lock just one table? In this case you
could open a recordset in exclusive mode. That might also
work if you just want to lock/delete a record. OTOH, why
not just delete the record and use error handling to detect
if the delete failed because another user was editing it?
 
Are you wanting to lock the database because you are performing perhaps a
make table query to update data?

If so, I have found it more gentle to perform a delete query followed by an
append query.

John
 
Back
Top