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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

performance of SQL statement vs query

Status
Not open for further replies.

Coban

IS-IT--Management
Nov 22, 2002
5
US
Would I get better performance by either embedding a SQL statement into a DoCmd.RunSQL statement or by calling up a query with a DoCmd.OpenQuery?
TIA, Ari
 
Ari,

If you save the query either as a query object or in the recordsource property of a form or a report, Jet will build a query plan the first time it is used, speeding performance on subsequent uses. A bit. If you do it in code, the plan has to be built every time the query is used. In most cases the difference is pretty small. In some cases I'll be willing to suffer a bigger hit because it gives me the ability to build the sql on the fly, in the code.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top