title: Transactions in a Foxpro & MYSQL Application
body: <p>With reference to This link <a href="http://msdn.microsoft.com/en-us/library/ms947432.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms947432.aspx</a></p>
  
  <p>Sample Code which I assume works since it is posted in Microsoft's site.</p>
  
  <pre><code>&amp;&amp; Start a VFP transaction and a transaction on the server.
  Begin Transaction  &amp;&amp; FoxPro Start Trans Command
  
  =SQLExec(nConnection, 'BEGIN TRANSACTION')  &amp;&amp; SQL Start Trans Commnad
  
  &amp;&amp; Update changes to MyTable.    
  lEverythingOK = TableUpdate( 2, .F., 'rv_MyView' )
  
  If lEverythingOK
   &amp;&amp; Update changes to MyOtherTable.
   lEverythingOK = tableupdate( 2,.F.,'rv_MyOtherView')
  EndIf
  
  &amp;&amp; End the transaction on the server and VFP.
  
  If lEverythingOK
   =SQLExec(nConnection, 'COMMIT')   &amp;&amp; SQL COMMIT COMMAND
   End Transaction                   &amp;&amp; Foxpro COMMIT COMMAND 
  Else
   =SQLExec( nConnection, 'ROLLBACK' )  &amp;&amp; SQL ROLLBACK COMMAND
   RollBack                             &amp;&amp; FoxPro ROLLBACK COMMAND
  EndIf
  </code></pre>
  
  <p>This sample is based on MS SQL and Foxpro using Remote View. I wanted to recreate this using MYSQL and Foxpro using Remote View. The Problem is if I issue the command TableUpdate, the record gets committed to MYSQL server even if I have not yet issued the      =SQLExec( nConnection, 'COMMIT' ) command. Im using INNODB Engine. Pls Note that if I omit the TableUpdate command, I am able to COMMIT or ROLLBACK my transaction from MYSQL. I was hoping not to remove the command TableUpdate to trap errors in my record so that I wouldt have to check for errors record for record before commiting it to MYSQL server.</p>
  
  <p>Thanks.</p>