title: MySQL & MsAccess 2007 - Error 3197 When Trying to Update
body: <p>I'm migrating an Access Database to MySQL.
  Most of the program works well but I still have a problem with an SQL query.</p>
  
  <p>I obtain a 3197 Run Time Error :</p>
  
  <pre><code>The Microsoft Office Access database engine stopped the process because you and another user are attempting to change the same data at the same time.
  </code></pre>
  
  <p>What I have already done :</p>
  
  <ul>
  <li>Configure my ODBC Driver to allow Dynamic Cursors </li>
  <li>Configure my ODBC Driver to return matched rows instead of affected rows</li>
  </ul>
  
  <p>The code which causes the error :</p>
  
  <pre><code>Dim rsMain As Recordset
  Dim rs As Recordset
  
  Dim db As Database
  Set db = CurrentDb
  
  Dim sqlQuery As String
  
  sqlQuery = "Select * from Table1 where field1 like '" &amp; Me.field10 &amp; "*' and field2=" &amp; Me.field11 &amp; " and field3=True"
  Set rsMain = db.OpenRecordset(sqlQuery)
  
  rsMain.MoveFirst
  Do Until rsMain.EOF
      sqlQuery = "select sum(field4) as Est, sum(field5) as Cons, sum(field6) as Prod from Table1 where field1 like '" &amp; rsMain("field1") &amp; "*' and field3=False and field5=" &amp; Me.modifiedDate
      Set rs = db.OpenRecordset(sqlQuery)
  
      rsMain.Edit
      rsMain.Fields("field4") = rs.Fields("Est")
      Set rs = Nothing
  
      rsMain.Update
      rsMain.MoveNext
  Loop
  Set rsMain = Nothing
  </code></pre>
  
  <p>The rsMain.Update command fails, it's where the error come from.
  I have similar code which don't cause any error. I am the only user at the time.</p>
  
  <p>Thanks in advance for your insights</p>