SqlLastRow&

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

Syntax

SqlLastRow& ( sqlconn% )

where

sqlconn%
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.

Returns

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

Remarks

If you do not turn on row buffering, SqlFirstRow&, SqlCurRow&, and SqlLastRow& always return the same value (the number of the current row).

If you turn on row buffering by setting the SQLBUFFER option with SqlSetOpt%, SqlLastRow& returns the number of the highest (newest) row of results in the buffer. For example, if a query returns 100 result rows and you read 20 rows into the buffer using SqlNextRow%, SqlLastRow& returns 20 regardless of which row is current. As the application processes and clears rows from the buffer using SqlClrBuf and more data is read from the server using SqlNextRow%, SqlLastRow& returns the number of the result row stored in the highest (newest) buffer location.

SqlFirstRow& returns the number of the result row stored in the lowest (oldest) buffer location.

See Also

SqlClrBuf, SqlCurRow&, SqlFirstRow&, SqlGetRow%, SqlNextRow%, SqlSetOpt%; DB-Library for Visual Basic Options