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

I just want to know your opinion

Status
Not open for further replies.

IGPCS

Programmer
Oct 26, 2006
431
US
please let me know what you think is better and works faster

A.) Typing a sql statement in the vba code

B.) Have the query build in the query builder and then call it with DoCmd.OpenQuery "Queryname"

Thank you for your opinion
IGPCS
Brooklyn, NY
 
I wouldn't think there would be any difference, at least not a noticeable difference. But I'd be interested to see other facts/opinions about it as well...
 
Option B is quicker.

Queries stored as querydefs are optimised by Jet. SQL statements stored as constants or in variables in VBA aren't.

TBH you probably won't notice the difference a lot of the time.

I frequently prefer to type them in VBA to avoid cluttering the DB window with hundreds of querydefs.

Ed Metcalfe.

Please do not feed the trolls.....
 
well i usualy build queries in the query builder and if its not a query that i need to view often i will mark them as hidden query so it dosnt bother the user, thats my opinion and it seems to work a little slower then typing it in vba
 
How are ya IGPCS . . .

When run the 1st time after editing queries are [purple]compiled and optimized[/purple], while SQL in VBA is not!

[blue]Your Choice! . . .[/blue]

Calvin.gif
See Ya! . . . . . .
 
if the aceman says so it is i like your comments
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top