Unanswered: diff between addnew and sql insert statement
this happen in VB 6
I tried to create a new record (oracle) by using SQL insert statement and .addnew/update method and found that SQL insert is much faster than .addnew/update mtd. Anybody know why ? If the table size is very big....is it better to use SQL insert than .addnew/update ?
The short answer is that it is always faster to do a direct sql statement over the addnew/update. Depending on the cursor and other properties, ado has to manage quite a bit when using the addnew/update. When dealing with open recordsets using the addnew method, ado has to manage whether a current record was being edited and if so it call update - and when you use addnew, ado caches the changes locally then on update posts the changes to the database and changes properties for the recordset object ... so there is much more going on behind the scenes than just a straight sql statement that returns a closed recordset object. Use the connection's execute method for non-row returning sql commands - such as insert/update/delete.