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

Rocky Smolin at Beach Access Software rockysmolin at bchacc.com
Wed Oct 29 11:47:12 CDT 2008


What luck!  I picked the right method (law of averages). 


Rocky Smolin
Beach Access Software
858-259-4334
www.e-z-mrp.com
www.bchacc.com
 
 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock
Sent: Wednesday, October 29, 2008 8:40 AM
To: accessd at databaseadvisors.com
Subject: Re: [AccessD] Which Is Faster - DAO or db.Execute?

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/> 



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list