SqlFirstRow&

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

Syntax

SqlFirstRow& ( sqlconn% )

where

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

Returns

The number of the first row in the row buffer. The first row returned is number 1. Use this return value when making a call to SqlGetRow%.

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%, SqlFirstRow& returns the number of the lowest (oldest) 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%, SqlFirstRow& returns 1, 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%, SqlFirstRow& returns the number of the result row stored in the lowest (oldest) buffer location.

SqlLastRow& returns the number of the result row stored in the highest (newest) buffer location.

See Also

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