Link to home
Start Free TrialLog in
Avatar of Michael Dean
Michael DeanFlag for United States of America

asked on

Database keeps telling me Recordset Locked

I have a Front End Data base and when I open a form to try to edit or create a new record.  
I receive at the bottom of the access form, a message that 'The Record Set is not updateable"
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

what is the record source of the form?
if it is a query, can you update the record source of the form?
If you open the query outside of the form, can up update it?  If not, please post the query.  It is quite likely that the query or a sub query includes some type of aggregation.  Once you aggregate data (sum(), Min(), Group By, Distinct, etc), Access looses the ability to identify individual records and the query becomes non-updateable.
Sometimes an error message is literally correct -- check the form's recordset to see whether it can be updated.  If the form is based on a query that joins two or more tables, most likely it is not updatable.  To see whether a recordset is updatable, open it in datasheet view and look at the bottom -- it should be like this:

User generated image
If it is not updatable, then you need to change the form's record source.  One possibility is to change it to a main form with a subform -- one table or query for each.
Avatar of Michael Dean

ASKER

So when I open the query in DataSheet view it does not allow for a new record to be created.  This just happened!   The database has been running smoothly.  I did see this in the Error Log.

3/15/2017 10:46:43 AM Error -2147467259: The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
 in Microsoft Access Database Engine v. 5.0.68 (30 april 2012).AddRecord.Execute line 0

INSERT INTO [TblDocuments] ([InvoiceID], [DateCreated], [Document], [ReportType], [Author]) VALUES ( 12244, #03/15/17 00:00:00#, "IME_Henry_Kathleen_3152017 104641 AM#\\dmcfileshare\DMC\documents\IME_Henry_Kathleen_3152017 104641 AM.doc#", "IME", "[EmployeeID]");
If the form is based on a query that joins two or more tables, most likely it is not updatable.
It isn't the number of tables in the query, it is the relationships.  I have queries with more than a dozen joins that are updateable.   As long as the relationships are hierarchical or the joins are to lookup tables, the query will normally be updateable.  Of course omitting primary keys does cause issues so make sure that EVERY table has a PK and make sure that you define relationships and enforce RI.

Did you look at the table definition?  What is the PK?  Are any columns defined to have unique indexes?

It doesn't look like the last VALUE field is correct.  It says -- "[EmployeeID]", Shouldn't it be the actual EmployeeID?
This has been working all along, not sure why the Query would have changed or any of the relationships.  Also the data base has created a record Lock file and it can not be deleted.
Did you actually look at the table in the BE to make sure no one changed it?

You're going to have to get rid of the lock file.  Make sure that everyone is truly out of the app.  Rename the FE so they can't accidentally get back in while you're working.  (if it is the FE that's locked, rename the BE.  You won't be able to rename the file associated with the lock file).  You will probably need the help of your network admin to get rid of the lock file if it is still not deletable even after you are certain that everyone is out.  He may need to reboot the server to get DOS to let go of the file.

Also, if by chance it is the FE that is locked and you are all sharing the same FE, STOP,  Your first step after getting rid of the lock file will be to distribute copies of the FE to each user so they always open their own copy of the FE.  The FE should NEVER be opened by multiple people simultaneously.  If you need help with distributing a FE, I can post a .bat file and there are other more sophisticated methods that use a separate database to check the version and only distribute a new FE as needed.
Yes I was able to remove the record lock. I created a new data base and copied the tables over. However the one table.

Tblclaims through and error when I tried to import.  I have attached the image of the specific error.

There appears to be some corruption perhaps of the table?  tblclaims
also the FE is not shared.  All users have their own copy.
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial