title: Writing to a VFP Database using the Visual FoxPro OLE DB Provider in PHP
body: <p>I am having trouble writing to a VFP database in php using visual fox pro OLE DB Provider (vfpoledb.dll). I have no problem accessing the data with select statements as described and answered in this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/9740869/php-odbc-vfp">Php, odbc &amp; vfp</a></p>
  
  <p>However when it comes to writing I am having trouble receving a </p>
  
  <pre><code>Cannot update the cursor ''tablename'', since it is read-only.
  </code></pre>
  
  <p>I thought the solution to this problem was to include <em>Mode="ReadWrite"</em> (have tried Share Exclusive also) in the Open command as described in the <a href="http://msdn.microsoft.com/en-us/library/aa903388%28v=vs.71%29.aspx" rel="nofollow noreferrer">msn article</a>, as such : </p>
  
  <pre><code>$conn = new COM("ADODB.Connection");
  $conn-&gt;Open('Provider="VFPOLEDB.1";Data Source="' . $filename . '";Mode="ReadWrite";');
  </code></pre>
  
  <p>However I still receive the same error when executing a statement such as:  </p>
  
  <pre><code>$up = $conn-&gt;Execute("UPDATE tablename SET fieldname='Testing' WHERE fieldname = 'somevalue'");
  </code></pre>
  
  <p>Any ideas, is it even possible?<br />
  Anyone else love wrapping legacy systems?</p>