Are DSUM and DLOOKUP functions slow ???

D

David

I modified a system and added a few DLOOKUP and DSUM statements and the system now runs much more slowly. Are these to blame? Are there any faster alternatives

Would it be faster to open and close a recordset and run an SQL. How would I do that.
 
P

Pavel Romashkin

Domain aggregate functions are known to be slow. I have not seen it in
reality but I almost never need them. I prefer recordset based functions
and SQL, which are faster. I use Seek and FindFirst in place of DLookup,
and SUM in SQL to get totals.
I resort to D-functions only when I am particularly lazy - they save
some typing. But I would never use them in a loop, calling them 500 times.
Pavel
 
B

Bruce M. Thompson

I modified a system and added a few DLOOKUP and DSUM statements and the system
now runs much more slowly. Are these to blame? Are there any faster
alternatives?
Would it be faster to open and close a recordset and run an SQL. How would I
do that.

Aggregate domain functions do not use indexes, so, as a general rule, using sql
and filtered recordsets would be faster. For a good example of a replacement
function for DLookup, see the following page at Allen Browne's web site:

http://members.iinet.net.au/~allenbrowne/ser-42.html

Note that this page also contains a good explanation of the shortcomings of the
DLookup function, some of which also apply to other aggregate domain functions.

See, also, the following page at The Access Web for a free download of
replacement functions written by Trevor Best.

http://www.mvps.org/access/modules/mdl0012.htm
 
D

Duane Hookom

I have seen lots of Access developers use DSum() etc in reports where Sum()
works much more efficiently.

--
Duane Hookom
MS Access MVP


David said:
I modified a system and added a few DLOOKUP and DSUM statements and the
system now runs much more slowly. Are these to blame? Are there any faster
alternatives?
Would it be faster to open and close a recordset and run an SQL. How would
I do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top