How is parametrizing a recordset faster than simply changing the filter and
reopening? I know that the parameter method will only generate one SELECT call
to the ODBC driver, wheras the filter method will rebuild the entire SELECT.
But how? When you change the parameters, the WHERE clause changes and it would
seem another SELECT statement would have to be sent to the ODBC driver. So
what kind of statements does the driver receive that makes the parametrizing
more effiecnt than refiltering? Thanks.
Chris
Chris,
Requery DOES NOT work when you change the filter or sort clauses, this is
stated wrong in the docs. It will only work with parametrised recordsets.
So what happens is that close/open, does a new SQLPrepare and then a SQLExecute
while Requery only does the SQLExecute. This may be much more efficient in
theory, but e.g. with SQL Server NT and simple queries, there is not that much
to gain. With complicated queries there is a significant advantage in
eliminating the prepare however.
-Ronald-