dbsettime

Sets the number of seconds that DB-Library waits for SQL Server to respond during calls to dbsqlexec, dbsqlok, dbresults, dbnextrow, and dbrpcexec.

Syntax

RETCODE dbsettime ( INT seconds );

where

seconds
Is the timeout value ¾ the number of seconds that DB-Library waits for SQL Server to respond before timing out. The default timeout value of 0 represents an infinite timeout period.

Returns

SUCCEED or FAIL.

Remarks

This function sets the length of time, in seconds, that DB-Library waits for a SQL Server response during calls to dbsqlexec, dbsqlok, dbresults, dbnextrow, and dbrpcexec. The dbsettime function does not override existing network timeout settings.

The dbsettime function can be called at any time during the application ¾ before or after a call to dbopen. It takes effect immediately upon being called.

To set a timeout value for calls to dbopen, use dbsetlogintime.

Note that if an application sends a command to SQL Server using dbsqlexec, control is not returned to the calling application until SQL Server completes the processing of the command. If the application program needs to continue execution while SQL Server is processing the command, it should send the command with dbsqlsend, continue its processing, and then, when it is ready to retrieve the results, call dbsqlok.

The program can call dbgettime for the current timeout value.

See Also

dbdataready, dberrhandle, dbgettime, dbnextrow, dbresults, dbrpcexec, dbsetlogintime, dbsqlexec, dbsqlok, dbsqlsend