Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Jan 2004
    Location
    Salem, Oregon, USA
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access 2003 releasing a lock (SP2)

    I have a subreport fueled by a query. At irregular and apparently random intervals, the subreport does not appear when the main report formats. This has happened as the first action taken after selecting a master record. After considerable detective work, it appears that the problem is caused by the table the query extracts from being locked. No error message is generated. As far as I can tell, no other process has addressed the table. Often, after the subreport has failed to display, a second attempt to open the report will format properly, indicating that the lock has released.

    Since I can't find any code that locks the table, is there any process I can invoke that will release the lock, whether or not it is set? I could just routinely unlock the table before calling the report. Any other clues would be greatly appreciated.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Access 2003 releasing a lock (SP2)

    Since a report is read-only, I don't understand why it would lock a table. But to be on the safe side, make sure that the Record Locks property of both the main report and the subreport is set to none.
    Also try to avoid overlap between the record source of the main report and that of the subreport.

    There is no code to "unlock a table", as far as I know.

  3. #3
    New Lounger
    Join Date
    Jan 2004
    Location
    Salem, Oregon, USA
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access 2003 releasing a lock (SP2)

    Thanks, Hans.

    All of the forms and reports are "No Locks. " All of the queries that touch the table are snapshot. I don't see how any lock can be set, other than by a bug in Access. The original query produced nothing but a dumb look (no error message), but when changed to a make-table query before invoking the report, it stopped with "Table is locked by another user or process." There are no other users. Again, rerunning after an interval of fiddling about completed normally. A phantom lock, I fear.

Posting Permissions

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