Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

which is faster, dlookup or creating an ado recordset?

Status
Not open for further replies.

bfellows

Technical User
Sep 17, 2002
10
US
On my current project, my program does a lot of checking whether or not there are any records returned from several different SELECT queries. My question is, should I be dumping the query into an ADO recordset and checking if the .count property is greater than 0, or should I just continue to use dlookup and checking if it returns a null or not?

dlookup is a faster way to type the code for sure, but I'm curious as to whether or not there's a bunch of overhead with this function that I'm unaware of.
 
Woah,

first ado is faster, much faster.

You shouldn't use the recordset count if you are just seeing if the recordset is greater then zero, use

if rst.eof or rst.bof this is faster than open a static recordset.

or, if you want to get the recordset count, you can use rst.getrows, get the array and then get the upperbound, that plus one is your recordset count.

Your fastest results would be to make sure you don't have any joins, and you are just opening tables with adopenreadonly; any joins will reduce performance greatly.

And if you are just polling results, and not doing any data changes, this should be really fast. I can do lookups on tables that are like.. 600,000 to 700,000 records on a wireless network in like 80 millesconds.





Mark P.
Providing Low Cost Powerful Point of Sale Solutions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top