2008-01-07

'Operation must use an updateable Query' OleDbException when using ADO with Excel files

When I was trying to run an insert query on an Excel database with ADO the following exception occured:

System.Data.OleDb.OleDbException: Operation must use an updateable query.

This means that the database is read-only, no records can be inserted.

Besides checking the permissions to your Excel file verify if the Extended Properties of the connection string contains the IMEX=1 expression. If yes, remove it. I dunno what it does but removing was the solution to my problem.

Post a Comment