SqlClrBuf

Clears rows from the row buffer.

Syntax

SqlClrBuf ( sqlconn%, rows& )

where

sqlconn%
Is a SQL Server connection. The value of sqlconn% is returned by SqlOpen%.
rows&
Is the number of rows to clear from the row buffer. If rows& is equal to or greater than the number of rows in the buffer, all but the newest row are removed. If rows& is less than 1, the call is ignored. Rows are cleared on a first-in/first-out basis.

Remarks

DB-Library for Visual Basic buffers rows as they are returned from SQL Server. If the row buffer fills completely, you can use SqlClrBuf to drop rows from the buffer.

Turn on row buffering by using SqlSetOpt% with the sqlbuffer option as follows:

SqlSetOpt%(sqlconn%, SqlBUFFER, "n")

Replace n with the number of rows you want to buffer. After turning buffering on, you can randomly refer to rows that have been read from SQL Server by using SqlGetRow%. The row buffer can fill completely when SQL Server returns more than the number of rows you specify. When the row buffer is full, SqlNextRow% returns buffull until you free at least one row by calling SqlClrBuf. SqlClrBuf frees the oldest rows in the buffer.

See Also

SqlGetRow%, SqlNextRow%, SqlSetOpt%; DB-Library for Visual Basic Options