"Cannot update. Database or object is read-only" in a query against a linked SharePoint view if there are unlinked lookup fields
Consider the following scenario:
- You are working in Microsoft Access.
- You execute update queries against a linked Microsoft SharePoint view.
- The underlying list that you are updating includes lookup fields that are not linked to Access because they are not included in the current view.
In this scenario, you receive the following error message:
Cannot update. Database or object is read-only.
This problem occurs when you use the ImportSharePointList macro action (as of Access 2016, previously known as TransferSharePointList) to link to a view of a SharePoint list in Access. This macro creates linked tables in Access for each lookup column in the SharePoint view. However, when the update query runs, it first checks that all lookup columns have linked tables in the database for the underlying list. The update query does not check exclusively for the lookups that are part of the current query.
To work around this problem, use one of the following methods:
Link all the lookup columns in the underlying list to tables. To do this, follow these steps:
- Link to the SharePoint list itself. This makes sure that all lookup tables for the underlying list are present within Access.
- Delete the linked table for the SharePoint list in Access. (Leave the linked tables for the lookup columns.)
- Link to the SharePoint view by using the ImportSharePointList macro action.
After you follow these steps, Access contains a linked table for the SharePoint view and linked tables for all the lookup columns in the underlying list instead of for only the lookup columns that are included in the view.
Disable caching in Access 2010. To do this, follow these steps:
- In Access, select File > Options.
- Select Current Database.
- Scroll down to the Caching Web Service area, and then locate the Microsoft SharePoint tables.
- Select the Never Cache check box.
For more information about known issues that occur when you use SharePoint lists in Access, see Access cache formats for SharePoint lists/document libraries.
For more information about the TransferSharePointList macro, see TransferSharePointList Macro Action.