Using Stored Queries
The Microsoft Access Desktop Database Driver supports using stored queries in a Microsoft Access database. Stored queries cannot be created by using the Microsoft Access driver; they must be created by using Microsoft Access or Visual Basic. Use stored queries as follows with the Desktop Database Drivers:
-
You can treat stored queries as views, so that you can perform a SELECT statement on the query just as you would from a table. This method is easy-to-use and intuitive, but it is not, however, the best method as far as performance is concerned, because the SELECT statement that invokes the query incurs the overhead of syntax checking and parsing.
-
You can treat stored queries as stored procedures. Use the {CALL query-name...} syntax to call the stored query (see the “Procedure Invocation” section earlier in this chapter). This is faster than treating the stored query as a view because syntax checking for the SELECT statement is bypassed and the stored query is directly invoked. Use parameter markers with this method to execute parameter queries. You cannot use parameter markers when a stored query is treated as a view.