SqlDataReady%

Indicates whether SQL Server has completed processing a command.

Syntax

SqlDataReady% ( sqlconn% )

where

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

Returns

SUCCEED (1) or FAIL (0). SUCCEED means that the data is available to be read.

Remarks

With SqlDataReady%, you can write an application that can continue processing while SQL Server is actually performing the database operation.

SqlDataReady% is ordinarily used after a call to SqlSend% and before a call to SqlOk%. After SqlSend%, SQL Server begins executing the statements in the command buffer. When SqlOk% is called, DB-Library for Visual Basic waits for SQL Server to complete processing before returning control to the application.

SqlDataReady% provides a way to determine when statement processing is complete. Call SqlDataReady% repeatedly until it returns a value other than 0. At that point, you can call SqlOk%.

Important Unless you provide a way for your application to time out, SqlDataReady% can return FAIL indefinitely if another process causes a conflicting lock or if the connection is broken.

See Also

SqlOk%, SqlResults%, SqlSend%