Returns the number of rows affected by a Transact-SQL command.
DBINT DBCOUNT(dbproc) DBPROCESS *dbproc;
A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and server.
The number of rows affected by the command, or -1. DBCOUNT will return -1 if any of the following are true:
The Transact-SQL command fails for any reason, such as a syntax error.
The command is one that never affects rows, such as a print command.
The command executes a stored procedure that does not execute any select statements.
The DBNOCOUNT option is on.
Once the results of a command have been processed, you can call DBCOUNT to find out how many rows were affected by the command. For example, if a select command was sent to the server and you have read all the rows by calling dbnextrow until it returned NO_MORE_ROWS, you can call this macro to find out how many rows were retrieved.
If the current command is one that does not return rows, (for example, a delete), you can call DBCOUNT immediately after dbresults.
If the command is one that executes a stored procedure, for example an exec or remote procedure call, DBCOUNT returns the number of rows returned by the latest select statement executed by the stored procedure, or -1 if the stored procedure does not execute any select statements. Note that a stored procedure that contains no select statements may execute a select by calling another stored procedure that does contain a select.