Freeing a Statement Handle

As mentioned earlier, it is more efficient to reuse statement handles than drop them and allocate new ones. Before executing a new SQL statement on a statement handle, applications should check that the current statement settings are appropriate. These include statement attributes, parameter bindings, and result set bindings. Generally, parameters and result sets for the old SQL statement need to be unbound (by calling SQLFreeStmt with the SQL_RESET_PARAMS and SQL_UNBIND options) and rebound for the new SQL statement.

When the application has finished using the statement, it calls SQLFreeHandle to free the statement. Note that SQLDisconnect automatically frees all statements on a connection.

To use a statement

See Also
SQLFreeHandle SQLFreeStmt


(c) 1988-98 Microsoft Corporation. All Rights Reserved.