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!

Speed difference between SQL and query

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
I have a Access2003 database where the backend is split from the frontend. A number of forms have combo boxes that lookup data in the backend and then load the data into the form in the OnChange event.

Would the the database run faster, network traffic etc., if I used a query as a control source for the combo box or an SQL statement as follows:
SELECT DISTINCT Tbl1.Field, Tbl1.Field2, FROM Tbl1 ORDER BY Tbl1.Field1;

Thanks
Eddy
 
Usually a saved query is a little faster than a SQL statement as the the "query plan" is already compiled.
But, for a such simple query, the difference should be minimal.
A real improvment would be to create an index on Tbl1.Field1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
i asume it should work faster

if i understood what you said i geuss it should

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
Thanks for the replys. I'm not sure what you mean by "create an index on Tbl1.Field1". I have never done this. I will look into it but can you give me some instruction?

Thanks,
Eddy
 
if you create an index it should work a bit faster as well

I will try my best to help others so will others do!!!!!
IGPCS
Brooklyn, NY
 
This is an easy one,

In the TABLE design, click on the field in question. You will notice a bunch of properties for that field at the bottom of the screen. The last option is "indexed" simply click it to say "YES" (You'll probably want it to also say DUPLICATES OK)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top