Search code examples
excelautomationanywhere

How to fix error "Cannot update. Database or object is read-only." Excel Database Automation Anywhere


I am accessing an excel file stored on a shared drive for now a couple of months without errors. All of a sudden, we have this issue popping out: Cannot update. Database or object is read-only.

My original connection string looked like this:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source="<FileName>";Extended Properties="Excel 12.0 Xml;HDR=Yes;".

I have tried the following one:

Provider=Microsoft.ACE.OLEDB.12.0;Data Source="<FileName>";Extended Properties="Excel 12.0 Xml;HDR=Yes;Readonly=0;"

and

Provider=Microsoft.ACE.OLEDB.12.0;Data Source="<FileName>";Extended Properties="Excel 12.0 Xml;HDR=Yes;READONLY=FALSE;"

but nothing provides good results.

I need to connect to this excel workbook and get the data in order to perform some business critical process, but nothing works so far as it always provides me with the mentioned error.

Any recommendation?


Solution

  • A solution that worked for me in that case was adding IMEX=1 at the end of the connection query.