[AccessD] Which Is Faster - DAO or db.Execute?

Gustav Brock Gustav at cactus.dk
Wed Oct 29 10:40:12 CDT 2008


Hi Rocky

  http://databaseadvisors.com/pipermail/accessd/2008-October/063676.html 

So, open your recordset, run the loop with the updates, close the recordset.
You may even wrap this in an transaction to further increase speed and to update all or - in case of an error - none.

Also, use ADO or DAO as you like. It will make no big difference - the point is to avoid the repeated SQL executes.

/gustav

>>> rockysmolin at bchacc.com 29-10-2008 01:34:42 >>>
Dear List:
 
In the detail event of a report, I want to set one of the fields in the
underlying recordset to true.  It's an invoicing report and I want to set
the detail record's 'Billed' field to true.  The Billed field is not on the
report - just a convenient time to set the flag.
 
Would it be faster to use db.Execute "Update...Where " or use DAO
rs.FindFirst.  The Where part of the db.Execute and the FindFirst both use
TimeSheetID for the search - a primary key. The table is a linked table - so
no Seek.  The number of detail records per invoice is pretty low - average
10-20.  So, not like it's updating a large number of records. So response
time is not an issue.
 
I wrote it with DAO - just a few lines of code - because I favor DAO.  So
more curiosity for future apps.
 
MTIA,
 


Rocky Smolin

Beach Access Software

858-259-4334

www.e-z-mrp.com <http://www.e-z-mrp.com/> 

www.bchacc.com <http://www.bchacc.com/> 






More information about the AccessD mailing list