Help Center

CODBCStmt.GetStmtQueryTimeoutmethod

Gets an SQLUINTEGER value corresponding to the number of seconds to wait for an SQL statement to execute before returning to the application.

DatabasesmethodCODBCStmt.incdocumented

Syntax

FUNCTION GetStmtQueryTimeout () AS SQLUINTEGER

Return value

The number of seconds to wait for an SQL statement to execute before returning to the application.

Result code (GetLastResult)

SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_ERROR, or SQL_INVALID_HANDLE.

Description

Gets an SQLUINTEGER value corresponding to the number of seconds to wait for an SQL statement to execute before returning to the application. If dwAttr is equal to 0 (default), there is no timeout.

Note: Optional feature not implemented by the Microsoft Access Driver.

Remarks

If the specified timeout exceeds the maximum timeout in the data source or is smaller than the minimum timeout, SetStmtAttr substitutes that value and returns SQLSTATE 01S02 (Option value changed).

Note that the application need not call CloseCursor to reuse the statement if a SELECT statement timed out.

The query timeout set in this statement attribute is valid in both synchronous and asynchronous modes.

Reference

  • Include file CODBCStmt.inc
  • Defined in AfxNova/COdbcStmt.inc:1789
  • Documented in Databases/ODBC Classes/CODBCStmt Class.md
  • Topic: CODBCStmt Class