SqlCancel%

Cancels the execution of the statements in the command buffer and flushes any pending results.

Syntax

SqlCancel% ( sqlconn% )

where

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

Returns

SUCCEED (1) or FAIL (0).

Remarks

When you call SqlCancel%, SQL Server stops executing the statements associated with sqlconn% or sqlconn& in the command buffer. Any pending results are read and discarded. You can call SqlCancel% after calling SqlExec%, SqlSend%, SqlOk%, SqlResults%, or SqlNextRow%. SqlCancel% cancels all statements in the command buffer. To cancel a single statement in a command buffer containing multiple statements, use SqlCanQuery%.

If you receive the DB-Library error 10038 "Results Pending," you can call SqlCancel to clear the pending results. If SqlCancel returns FAIL, the server may not be able to respond to the cancel request. Either continue to call SqlCancel until it returns SUCCEED, or close the DBPROCESS connection and open a new one.

See Also

SqlCanQuery%, SqlExec%, SqlNextRow%, SqlOk%, SqlResults%, SqlSend%