Saved Query versus VB Query

  • Thread starter tobesurveyor via AccessMonster.com
  • Start date
T

tobesurveyor via AccessMonster.com

Good afternoon to all-

I am creating a new version of an application and am trying to make it as
efficient as possible. Is there any difference between having a saved query
versus a query that is defined in VB. Are there any practical reasons to use
one instead of another?

Thanks in advance,
Chris
 
J

Jeff Boyce

By efficient, do you mean fast? You could create both versions and test the
speed difference (but you might need to run each 100 or 1000 times to
actually see a total difference).

From a practical standpoint, I often create one/more "base" queries, then
create secondary queries that use the base query(ies). If you are working
in code, using SQL statements, you might need to create a much more complex
SQL statement to reach the same result.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jerry Whittle

Access optimizes the execution plan of a saved query (including those used in
the record source of a form or report) the first time it is run and saves
this information for future use. Therefore a saved query should be faster
than the same query executed in VB.

BTW: That's why when testing a query for performance, you should run it
twice or more and not worry too much about the first execution as long as
it's returning the correct records.
 
Top