none
OleDbCommand 'Operation must use an updateable query' RRS feed

  • Question

  • Dear all,

    I am using .Net framework 4.5 and ACE.OLEDB.12 to open a MS Access database.

    The connection string of the OleDbConnection is:

    "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + strFile + ";Mode=Share Deny Write;"

    Share Deny Write is used so that when the access file is opened by another user/application, the 'new' user/application is readonly to the access file.

    When I try to execute an Update Sql Command by an OleDbCommand object (which binds to the specified OleDbConnection), it throws the error: 'Operation must use an updateable query'.

    When I amend the connection string by removing the ";Mode=Share Deny Write;" phrase, it works properly (but it fails to let another user/application to readonly to the file).

    How can I solve this problem?

    Thanks.

    • Moved by Kristin Xie Friday, December 18, 2015 6:38 AM move to better forum
    Thursday, December 17, 2015 9:57 AM

Answers

All replies