Results 1 to 8 of 8

Thread: MS access error

  1. #1
    Join Date
    Mar 2009
    Posts
    27

    Unanswered: MS access error

    Hi,

    Can anyone help me with this error. I am unable to open the DB file due to this error (attached)

    R
    Attached Thumbnails Attached Thumbnails image001.jpg  

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Find EVERYONE that is in the mdb file and have them close out. Someone has the mdb file open (and locked it) OR you need to compact/repair the mdb file (the *.ldb file is corrupt in that folder which compact/repair fixes.) If it continuously happens, see the cloning script in the code bank.

    Once you're absolutely sure everyone is out, open the mdb file while holding down the shift key. Compact/repair the mdb file (ie. Tools.) Close the mdb. Make sure there's no *.ldb file (with everyone out of it.) If there's still an *.ldb and everyone is out, open and compact/repair again (you may have a deeper problem then.)
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Mar 2009
    Posts
    27
    there's no one logged on the file...it would have shown the Security file in locked mode. Plus when i try opening it, it gives me this error and due to which it does not let me repair. how do i do this...."see the cloning script in the code bank."

    Also, what is the solution if i think this is a deeper problem ?

    R

  4. #4
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    If you're not in the mdb and no one else is in the mdb, you shouldn't see an *.ldb file. If you do, someone is in it (or it needs compacting/repairing).

    Open the mdb while holding down the shift key. Select Tools -> Database Utilities -> Compact and Repair.

    Close the mdb. If you still see an *.ldb file, chances are someone still has this open somewhere (you should check to see if it's hungup on a citrix/network connection for a specific user.) Typically, compacting/repairing fixes the problem and you will no longer see an *.ldb file after you close the mdb. Almost all the time, someone is still in it or their "session" is hungup with it trying to still connect to the *.ldb file. You can try to delete the *.ldb file if you're absolutely sure no one is in the mdb. Usually you can't delete this file. You can also locate the JetUtil (google it) and download and try to fix the mdb using that tool by Microsoft.

    The script and explanation can be found here: http://www.dbforums.com/6274786-post19.html

    Also, Make sure EVERYONE who is using the mdb has WRITE and READ permissions to that folder (not just READ permissions - has to be WRITE also.)
    Last edited by pkstormy; 08-24-09 at 23:18.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  5. #5
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    The "deeper" problem is the forms are designed incorrectly (you have the same recordset being updated via multiple forms open simultaneously.) Simplify your form design if it's overly complex (ie. multiple forms and subforms on forms against the same table.) (ie. the exact same data field can be updated from 1 of X forms which are all opened at once.)
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  6. #6
    Join Date
    Jun 2009
    Posts
    6

    MS access error

    You can try to repair your database using compact and repair utility.

    First open your mdb file then select Tools -> Database Utilities -> Compact and Repair.



    Quote Originally Posted by orajat View Post
    Hi,

    Can anyone help me with this error. I am unable to open the DB file due to this error (attached)

    R

  7. #7
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    I have also seen where everyone is out of the database but someone exitted incorrectly and they need to shutdown and restart. I would try shutting down each system that may have accessed the database if possible.

  8. #8
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    Actually I was totally wrong with my previous replies and I sincerely apologize. After looking at the error closer, I think with this specific error, you need to add a Refresh command (or requery command) at the beginning of the event that is firing and triggering this error. If it's happening in code and you're trying to update a recordset, you need to refresh or requery the record on the form first (that's based on the same table which you're trying to update.) If it's happening after opening and updating a record on a form, you need to refresh/requery any other forms open that are based on the same recordsource before opening the form.

    I originally thought this was a locking problem and a corrupt *.ldb file (the error is very similar) but this specific error is due to the same recordset open somewhere else (either in code because you didn't close a specific recordset (ie. rs.close) or on another form) and you're trying to update the same record somewhere else either in code or by opening another form (MSAccess is getting confused because you have that record open (usually on a form) and you're trying to open another form/code using that same record. MSAccess thinks another user is trying to update the same record and isn't sure who or what form that's open is actively updating the record. A Refresh or Requery command tells MSAccess that you've completed updates on the form for that record so that your other form opening (or code executing) can then utilize that record.)

    For example, if you're getting this error when opening a 2nd form and updating it, put the Refresh command (or me.requery) in the code (ie. for the button on the 1st form that opens the 2nd form if it's based on the same table) before the actual code to open the 2nd form. If you also had a 3rd form open based on the same record/table, then you'd need to issue a Requery command to that form (ie. Forms!My3rdFormName.requery or for a subform: Forms!My3rdFormName!My3rdSubFormName.requery). The Refresh command is just: Refresh and only refers to the active form (ie. you can't use: Forms!My3rdFormName.Refresh). Note also that a Refresh command will keep you on the same record on the form while a me.requery command 'may' cycle the form to another record (if the form is based on more than 1 record.) The pro's to using .requery is that you can use it to requery other forms.

    Note also that this can get fairly complex if you have multiple forms/code opening based on the same table.

    The rule I usually follow is only keep 1 form open at a time based on the same table that's actually updating the recordset. If updating a value in code for the same record, make sure the recordset of every form (that's open and again based on the same record and is actively being used to update) is first refreshed before updating in code!

    This problem also typically shows up on a form which is being updated and the underlying table doesn't have an autonumber field defined. It's one reason I always create an autonumber field for any data tables.
    Last edited by pkstormy; 10-30-09 at 20:34.
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

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