Question

I've encountered a strange error when attempting to update a SharePoint 2010 list that I have linked to via Microsoft Access 2010.

Error: Data cannot be inserted because there is no matching record.

Microsoft Access - Data cannot be inserted because there is no matching record.

This occurs in 2 scenarios:

  1. I attempt to run any UPDATE query against the list in MS Access
  2. I attempt to update a record from the list if the list view is filtered

The second item might need an explanation. If I simply open the linked list in Access, scroll down to a record I want to edit, and edit it, it works. If I filter that view first (for example, showing only records with a checkbox field checked), I cannot edit any records and get the error.

This only happens in one particular environment; others work fine with either approach. I've checked permissions (I have full control of the list, I am a Site Collection Administrator, etc.). I have tried linking to the list in various ways: from within Access, from the "Open with Access" ribbon button in SharePoint. I've deleted and recreated the Access DB file... no luck.

Also, Google has no knowledge of this particular error: searches for the exact error text come up with 0 results.

Any idea what to check? Running SQL-style queries against this SharePoint list is the only viable option for maintaining it.

Was it helpful?

Solution

I determined the problem. As I was manually editing some more records in the "unfiltered" view of my SharePoint list, I found that the occasional record would still not update and throw the same error.

I happened to notice the records that would not update had another column set, which was a lookup column (you're right, Remou). But oddly, the ID value was displaying and not the lookup value. This didn't make sense, as MS Access had also linked all related lists.

I opened up the appropriate lookup list only to find Access was not retrieving any of the values. This again was odd, because the values existed in SharePoint, and the lookup relationship was intact were you to edit the same record in SharePoint. I couldn't force Access to update or fix its connection to the list.

I ended up deleting the lookup SharePoint list and recreating it. This solved the MS Access problem.

OTHER TIPS

I experienced the same symptoms - meaning that any Update query to a particular SharePoint list from MS Access 2010 failed with this error - but my fix was different. The solution above did get me looking in the right direction, however.

In my case, I had no user-defined lookup fields in the list. When you link to a list, however, there is an implicit lookup table called UserInfo that is also created in Access when the linked table is created. When I examined this UserInfo table, it contained only a single record and it should have contained dozens.

My fix was to right-click this table in Access, More Options..., Relink Lists...

I entered the existing SharePoint site and lists as if they were new ones. The UserInfo table now contained the appropriate number of records and the error on Update ceased.

I found that update query started to work when I included the linked tables (that had the lookups) in the update query.

I have yet another fix. I had my lookup SharePoint lists already linked into Access, but I had just entered another value that I was trying to use when appending records from one list to another, inserting this new value for that column. I had tried all the relinking, etc. first, but it didn't work. I tried linking the UserInfo table and that didn't help either. I had to OPEN the lookup list from within Access and then it worked. (I also opened the UserInfo table, but I don't think that is really what worked.)

The previous answers, however, led me along the right path, so thanks!

I encountered the issue and the responses above were helpful but not quite on point. This is what caused the error for me:

My issue was that I am including a user's ad name as one of the fields I am appending - the SharePoint list field is a "person or group" colum. Sharepoint is trying to translate the UID I am passing into a user name using the Userinfo table. But I am trying to add records where the assignee is undetermined, so the field is to be left blank. My Access routine was defaulting to zero, attempting to enter that, and then SharePoint's internal lookup to get the username was failing since there is nobody in AD with record #0. This bit me after lots of successful testing - just suddenly nothing would work anymore. Of course in hindsight it was because I tried appending a different set of test data records.

I had the same issue happen to me. After 15 hours of trial and error, I fixed it.

I had a list where one of the columns was a lookup column to another "parent" list. Somehow, there was a value in that lookup column that WAS NOT in the "parent" list.

When access tried to update the non-lookup field, it ran its own integrity check and realized that the value in my lookup was not found in the parent list and error-ed out with your error.

Hope this helps

In my case, I found that it did not make a difference to either relink or refresh my attached list that threw this error. However - when I initially attached to my SharePoint list, an additional list was automatically linked in my database. By right-clicking that secondary list > more options > clicking "refresh list", I no longer got the error message on my primary attached list.

This error happens from time to time on the same primary list - but now I know how to get around it.

I found it helpful to read more about attached lists here: http://office.microsoft.com/en-us/access-help/import-from-or-link-to-a-sharepoint-list-HA001230313.aspx

I think this occurs when any value in the List you are updating has an invalid value. For instance if a list item has no value in a required field or a list item has a illegal value in a field with specified criteria, you will get this error when it hits the first list item in an 'invalid state' during the update.

"I think this occurs when any value in the List you are updating has an invalid value. For instance if a list item has no value in a required field or a list item has a illegal value in a field with specified criteria, you will get this error when it hits the first list item in an 'invalid state' during the update."

I can confirm that what Guy wrote worked for me. I had to look at all the fields in the list I was updating that are look ups and ensure that the data was valid. I did this by searching for blanks and fixing the ones that come up as blank but still had data.

I found this error in yet another scenario. This is observed using SP 2013 on prem and Access 2013.

When I create an Access database using the "Open with Access" button from a list page in the SP UI, and then I link additional tables (for other lists) into that database, I cannot run update queries on those additional tables. I get the error message shown by the OP. However, if I start with a blank Access database and link all of the tables (lists) I want to use when I first create the database, then the update queries work on all of them.

As with the other posters, my lists do have lookup columns and people columns, and in both scenarios, Access did appear to automatically add the supporting tables for those columns. It seems like when I use that "Open with Access" button, only that table gets "correctly" linked to the supporting tables. In scenario two, everything seems to be linked correctly. In inspecting the two databases, I couldn't spot what was different. But empirically, scenario two succeeded where scenario one failed.

I had a similar issue, linking to a Sharepoint List (List1) that I'd just exported from Access to Sharepoint. When I linked to List1, I also found that 'UserInfo' was added as a linked list. I deleted that UserInfo link believing it to be unnecessary, but then found that I generated validation errors when trying to update List1 with an append query. Restoring the link to UserInfo fixed those errors; presumably the 'Created By' and 'Modified By' columns added by Sharepoint to List1 require the Lookup to UserInfo. The answers above pointed me in the right direction, so thank you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top