title: Recordset.Edit or Update sql vba statement fastest way to update?
body: <p>I recently came across vba update statements and I have been using <code>Recordset.Edit</code> and <code>Recordset.Update</code> to not only edit my existing data but to update it. </p>
  
  <p>I want to know the difference between the two: <code>recordset.update</code> and <code>Update sql Vba</code> statement. I think they all do the same but I can't figure which one is more efficient and why. </p>
  
  <p>Example code below:</p>
  
  
  
  <pre class="lang-vb prettyprint-override"><code>'this is with sql update statement
  dim someVar as string, anotherVar as String, cn As New ADODB.Connection
  
  someVar = "someVar"
  anotherVar = "anotherVar"
  
  sqlS = "Update tableOfRec set columna = " &amp;_
           someVar &amp; ", colunmb = " &amp; anotherVar &amp;_
                                      " where columnc = 20"; 
  
  cn.Execute stSQL
  </code></pre>
  
  <p>This is for recordset (update and Edit): </p>
  
  <pre class="lang-vb prettyprint-override"><code>dim thisVar as String, someOthVar as String, rs as recordset 
  thisVar = "thisVar"
  someOthVar = "someOtherVar"
  
  
  set rs = currentDb.openRecordset("select columna, columnb where columnc = 20")
  do While not rs.EOF
     rs.Edit
     rs!columna = thisVar
     rs!columnb = someOthvar
     rs.update
  
     rs.MoveNext
  loop 
  </code></pre>