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

Stuart McLachlan stuart at lexacorp.com.pg
Wed Oct 29 16:10:38 CDT 2008


If it's a valid statement that has problems because of constraints such as Nulls not allowed, 
or trying to duplicate Unique index, Max is correct - it doen't throw a warning.  


On 29 Oct 2008 at 9:42, Drew Wutka wrote:

> Hmmmm, I don't think so. If you put in an invalid SQL statement, it will
> return an error.  However, if you, say, try to update a record that
> doesn't exist, it should just go through, since it would be a 'now
> updating 0 records'....
> 
> Drew
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Max Wanadoo
> Sent: Wednesday, October 29, 2008 9:36 AM
> To: 'Access Developers discussion and problem solving'
> Subject: Re: [AccessD] Which Is Faster - DAO or db.Execute?
> 
> I *think* also that, unlike the recordset.edit/.update, the
> db.execute(sql)
> statement does NOT throw an error if it meets an anomalous condition
> whilst
> executing the sql.  It just continues on.
> Am I correct there?
> Max
> 
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Drew Wutka
> Sent: 29 October 2008 14:33
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] Which Is Faster - DAO or db.Execute?
> 
> I believe that db.execute is going to be faster, and the reason it
> should be faster is that the recordset object is going to internally use
> SQL commands to the DB engine anyways, so it is another layer on top of
> the DB engine....
> 
> But that's just a well educated guess, not 100% positive about that.
> 
> Drew
> 
> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin
> at Beach Access Software
> Sent: Tuesday, October 28, 2008 7:35 PM
> To: 'Access Developers discussion and problem solving'
> Subject: [AccessD] Which Is Faster - DAO or db.Execute?
> 
> 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
> The information contained in this transmission is intended only for the
> person or entity to which it is addressed and may contain II-VI
> Proprietary
> and/or II-VI Business Sensitive material. If you are not the intended
> recipient, please contact the sender immediately and destroy the
> material in
> its entirety, whether electronic or hard copy. You are notified that any
> review, retransmission, copying, disclosure, dissemination, or other use
> of,
> or taking of any action in reliance upon this information by persons or
> entities other than the intended recipient is prohibited.
> 
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.
> 
> 
> -- 
> 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