dblastrow

DB Library for C

DB Library for C

dblastrow

Returns the number of the last row in the row buffer.

Syntax

DBINT dblastrow ( PDBPROCESS dbproc );

Arguments

dbproc

Is the DBPROCESS structure that is the handle for a particular workstation or Microsoft® SQL Server™ 2000process. It contains all the information that DB-Library uses to manage communications and data between the workstation and SQL Server.

Returns

The number of the last row in the row buffer. The first row returned from SQL Server is number 1.

Remarks

If you aren't buffering rows, dbfirstrow, dbcurrow, and dblastrow always have the same value. If you have enabled buffering by setting the DBBUFFER option, dblastrow returns the number of the last row in the row buffer, which may not be the last row available from the server. Use this return value with a call to dbgetrow. For example, if a query returns 100 result rows and you read 20 rows into the buffer using dbnextrow, dblastrow returns 20 regardless of which row is current. As the application processes and clears rows from the buffer using dbclrbuf and more data is read from the server using dbnextrow, dblastrow returns the number of the result row stored in the highest (newest) buffer location.

See Also

Bulk-Copy Functions

dbgetrow

dbclrbuf

DB-Library Options

dbcurrow

dbnextrow

dbfirstrow

dbsetopt