dbdataready

Determines whether database command processing sent data back to the client is ready to be processed.

Syntax

BOOL dbdataready ( PDBPROCESS dbproc );

where

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

Returns

TRUE if data is available to be read; FALSE otherwise.

Remarks

This function allows an application to continue processing while SQL Server is actually performing the database operation.

The dbdataready function is ordinarily used after a call to dbsqlsend and before a call to dbsqlok. After dbsqlsend, SQL Server begins executing the commands in the command buffer. When dbsqlok is called, Microsoft DB-Library for C waits for SQL Server to finish processing before returning control to the application.

The dbdataready function provides a way to determine when data is available for processing. It should be called repeatedly until it returns a nonzero value. At that point, the application can call dbsqlok, dbresults, dbnextrow.

Important It is possible for dbdataready to return FALSE forever if another process has a conflicting lock or if the connection is broken. The calling program should contain a timeout mechanism.

See Also

dbresults, dbsettime, dbsqlok, dbsqlsend; Building Applications