Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Checking for a locked record (Acc 97 sr2 on 95b)

    Is there a way to check if a table has a locked record in it?

    I tried to run an update query and had it tell me that 1 of the records in the table was locked.
    While this has only happened once, I would like to be able to guarentee that the update runs every time by putting in a check loop that will try so many times and then bomb out with a message saying "Update has not run, please try again." This update is manually run by an operator.
    "Heading for the deep end"

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Checking for a locked record (Acc 97 sr2 on 95b)

    The simplest way would be to trap the error, pause for a moment and then retry it. However, what you're actually running into with Access 97 is a page lock, and you need to check your design to try to avoid those as much as possible. Under what circumstances is the update being run? What might have created a lock that is interfering?
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Nov 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    330
    Thanks
    10
    Thanked 0 Times in 0 Posts

    Re: Checking for a locked record (Acc 97 sr2 on 95b)

    Charlotte,

    the job table has a column called totalhours that keeps a running total of the hours spent on the job. This value is updated daily from the work report from the previous day.
    This table also feeds a form that allows the details for the job to be viewed.
    Someone had one of the records that I wanted to update open on another machine.
    The update needs to be done between 8-9am each day.

    I have to learn to write error trapping into my codes for this sort of situation.
    "Heading for the deep end"

Posting Permissions

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