QueryTimeout Property

See Also   Applies To

Sets or returns a value that specifies the number of seconds to wait before a timeout error occurs when a query is executed on an ODBC data source.

Syntax

VOIDSetQueryTimeout(SHORT sTime);

SHORTGetQueryTimeout(VOID);

Parameters

Type Argument Description
SHORT sTime An integer specifying the number of seconds before DAO times out. The default value is 60.

Remarks

When you're using an ODBC database, such as Microsoft SQL Server, there may be delays due to network traffic or heavy use of the ODBC server. Rather than waiting indefinitely, you can specify how long to wait.

When you use QueryTimeout with a CdbConnection or CdbDatabase object, it specifies a global value for all queries associated with the database. You can override this value for a specific query by setting the ODBCTimeout property of the particular CdbQueryDef object.

In a Microsoft Jet workspace, you can override the default value by creating a new “ODBC” key in the Registry path \HKEY_LOCAL_MACHINE\SOFTWARE\Jet\3.5\, creating a QueryTimeout parameter in this key, and setting the value as desired.