Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2008
    Location
    North Carolina
    Posts
    6

    Unanswered: Record Locking Form

    Hello Everyone!
    I'm placing a sample database here to demostrate what I'm doing. I have a form that will lock the record once the user has pulled it up on their screen preventing other users from accessing the same record creating write conflicts. However I noticed that if 2 users are pulling going to the next record at the exact same time it does create a write conflict. I thought maybe I could add a timestamp so that access would look at the exact time to see who opened the record first and shut down the other. Any ideas on this? Here is the sample database....
    Attached Files Attached Files

  2. #2
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    There is inbuilt locking:
    Tools > Options > Advanced > Default Record Locking
    George
    Home | Blog

  3. #3
    Join Date
    Jan 2008
    Location
    North Carolina
    Posts
    6
    Hi George,
    That was my fist try but in a multiuser enviroment with over 10 users accessing the records at the same time I began to receive write conflict errors. Therefore I needed to manually create something that would avoid this. Now I get less write conflicts but if 2 users go to the next record at exactly the same time I will still get a write conflict pop-up message.

    Thanks

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    depending on what version of Access you are running you shouldbe able to use record level locking, which cam in from 2000 on (JET 4?)

    You should not have any problems what soever with that, unless you are doing table locks manually, or are usign some odd priamry key generation.

    tools | options | advanced | select "edited record lock"

    failing that you will need to switch of record locking and implement your own strategy to handle record contentions.

    If 2 users 'go for the same record at the same time" you will always have these problmes..... its par for the course, bno db system can automatically handle that.

    In this circumstance the best thign you can do is write your own error handler and try to merge the changes.. good luck. Ive alwasy told my users that its tough.... first person in secures the lock, second person in has to re do their changes later.

  5. #5
    Join Date
    Jan 2007
    Location
    UK
    Posts
    11,434
    Provided Answers: 10
    Quote Originally Posted by healdem
    no db system can automatically handle that
    Are you sure about that one?

    On the back of Healdems response; go unbound with your forms, use your timestamp idea and then on save of the record you can code your own procedure to check the timestamp against the original record and prompt the user when necessary.
    George
    Home | Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •