The SQL Server driver can have only one active hstmt unless the driver is used with server cursors. The driver returns this information through SQLGetInfo with the SQL_ACTIVE_STATEMENTS option. An hstmt is defined as active if it has results pending. In this context, results are any information returned by SQL Server, such as a results set or a count of the rows that are affected by an UPDATE statement.
Note An hstmt's activity is not related to its state. For example, if a SELECT statement is executed and it does not return any rows, the statement is not active, because no results are pending. However, before the statement can be executed again, the cursor associated with it must be closed with SQLFreeStmt.
When connected to SQL Server 6.x, the SQL Server driver supports multiple active statements on a single connection when server cursors are used.
When connected to SQL Server 4.2x, the SQL Server driver supports only one active statement per connection. The cursor library (shipped with the SQL Server driver) allows applications to use multiple active statements on a connection.