Record Locking

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mannyf50
    New Member
    • Feb 2008
    • 6

    Record Locking

    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!
  • Scott Price
    Recognized Expert Top Contributor
    • Jul 2007
    • 1384

    #2
    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

    Comment

    • Mannyf50
      New Member
      • Feb 2008
      • 6

      #3
      Originally posted by Scott Price
      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?

      Comment

      • Scott Price
        Recognized Expert Top Contributor
        • Jul 2007
        • 1384

        #4
        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,
        Scott

        Comment

        • Mannyf50
          New Member
          • Feb 2008
          • 6

          #5
          Originally posted by Scott Price
          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,
          Scott
          man that would be awesome Scott! Thanks allot

          Comment

          • Scott Price
            Recognized Expert Top Contributor
            • Jul 2007
            • 1384

            #6
            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,
            Scott

            Comment

            Working...