Hey guys, im trying to write some code to lock a record and prevent anyone from viewing/editing that record until that record has been edited and the user has moved on to the next record.... any idea how??? Thanks!
Record Locking
Collapse
X
-
Unless I'm misunderstandin g what you are referring to, this is automatically handled by Access already. No need to duplicate their efforts. The .ldb file keeps the log of who is accessing which record and when, thereby preventing two users from changing the same data at the same time.
Regards,
Scott -
i also dont want them to be able to view the data either, until its been edited by the person, any idea how?Originally posted by Scott PriceUnless I'm misunderstandin g what you are referring to, this is automatically handled by Access already. No need to duplicate their efforts. The .ldb file keeps the log of who is accessing which record and when, thereby preventing two users from changing the same data at the same time.
Regards,
ScottComment
-
In my experience working with this type of situation, the least of your worries is having someone be able to view a record that someone else is in the process of updating.
I'm not aware of a simple way to do what you are asking, it may well be that there is a way to do this, but it would require some fairly intrusive code. I think you'll find that the risks outweigh the benefits.
If you wish to go ahead, I can do a little research, but I can't hold out a lot of hope on turning up anything magic.
Regards,
ScottComment
-
man that would be awesome Scott! Thanks allotOriginally posted by Scott PriceIn my experience working with this type of situation, the least of your worries is having someone be able to view a record that someone else is in the process of updating.
I'm not aware of a simple way to do what you are asking, it may well be that there is a way to do this, but it would require some fairly intrusive code. I think you'll find that the risks outweigh the benefits.
If you wish to go ahead, I can do a little research, but I can't hold out a lot of hope on turning up anything magic.
Regards,
ScottComment
-
Have a look at this MS knowledge base article that discusses optimistic versus pessimistic record locking.
Let your fingers do a little walking through the help files and you will find out how to implement pessimistic, page level locking. (I´m not at my main computer for the next two days, so can´t do more of this for you, but you`ll learn more this way :)
Page level locking means that when a user edits one record, any records that are contiguous and fit within the 4kb page size are locked as well.
Good luck and regards,
ScottComment
Comment