dbsettime

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

Syntax

RETCODE dbsettime ( INT seconds );

Arguments
seconds
Is the time-out value, or the number of seconds that DB-Library waits for SQL Server to respond before timing out. The default time-out value of 0 represents an infinite time-out 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 time-out 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 time-out 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 time-out value.

See Also
dbdataready dbrpcexec
dberrhandle dbsetlogintime
dbgettime dbsqlexec
dbnextrow dbsqlok
dbresults dbsqlsend


(c) 1988-98 Microsoft Corporation. All Rights Reserved.