SQL vs Query as a source

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a continuous subform showing records which meet criteria selected in
the main form. Currently, the source for the subform is a query. I believe
I can get the same result by putting in an SQL statement, though, so my
question is this: Is there a significat advantage or disadvantage to using
the query over an SQL statement?

The query is easier for me to set up, but does it take more memory or result
in a 'slower' database? Also, I have some concerns that, despite
precautions, the query would be easier for a user to accidently alter or
delete.

This database will eventually house quite a bit of information (at least 1
GB), so I figure that even small differences may wind up being significant.
Any thoughts or suggestions are greatly appreciated.
 
If you are using a saved SQL statement (ie the SQL is the value of the
Recordsource property when the form is saved), there is no difference
because that SQL is actually saved as a query (hidden) and it is therefore
also optimized. If you are using VBA to create an SQL statement which is
then assigned to the Recordsource property you might have a slight
difference where the saved query is faster since it is already compiled and
optimized.

Regardless, what is far more important is to have a query written to the
tightest possible criteria so that only the required rows are returned and
to make proper use of indexes between the main and subform.

If you have properly secured the database, the user should not be able to
alter or delete the query.
 
Back
Top