CompuServe Thread

Parameters are Quicker

2 messages in this thread
#30222From: Chris BluethmanJul 8, 1994 12:32 AM
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
#30402From: Ronald LaeremansJul 10, 1994 3:37 AM
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-