ADODB.Connection.Execute VS ADODB.Recordset.Update 
Author Message
 ADODB.Connection.Execute VS ADODB.Recordset.Update

Hi There,

Which method would be more efficient to use, the Connection.Execute method
or opening the recordset, setting the required values and calling the
recordset's update method?

Josh



Wed, 28 Sep 2005 21:03:10 GMT  
 ADODB.Connection.Execute VS ADODB.Recordset.Update

Hi There,

Which method would be more efficient to use, the Connection.Execute method
or opening the recordset, setting the required values and calling the
recordset's update method?

Since using the Recordset methods involves automation (and additional
instructions) there would be more overhead than executing a SQL statement if you
are updating a single row. If you are updating multiple rows the difference will
be magnified.

However, your code might be a bit easier to read using the Recordset methods and
the performance may not matter when performing single row updates.


Microsoft MVP (Visual Basic)



Wed, 28 Sep 2005 22:18:23 GMT  
 ADODB.Connection.Execute VS ADODB.Recordset.Update


Quote:
> Hi There,

> Which method would be more efficient to use, the Connection.Execute method
> or opening the recordset, setting the required values and calling the
> recordset's update method?

> Josh

You might also consider using the UpdateBatch method. Make all your changes
then update the whole shebang.


Thu, 29 Sep 2005 22:33:52 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. ADODB.Connection and ADODB.Recordset question

2. ADODB.connection & ADODB.Recordset

3. Creating adodb.record from Adodb.recordset

4. ADODB.Recordset.Update does not update?

5. return the result text from a VB ADODB.Connection.Execute command

6. Problems with ADODB.Connection.Execute( query)

7. Dataenvironmant vs. ADODB.Connection

8. ADODB.Recordset Conn. to Oracle vs MSSQL

9. Arrays vs. disconnected adodb.recordset

10. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

11. adodb connection to excel: recordset.fields(i).value=null for fields with numeric value

12. help please adodb connection and recordset

 

 
Powered by phpBB® Forum Software