Share via


Visual Basic: RDO Data Control

QueryTimeout Property (Remote Data)

See Also    Example    Applies To

Returns or sets a value that specifies the number of seconds the ODBC driver manager waits before a timeout error occurs when a query is executed.

Syntax

object**.QueryTimeout** [= value]

The QueryTimeout property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A Long integer representing the number of seconds the driver manager waits before timing out and returning an error.

Remarks

The default QueryTimeout property setting is 30 seconds. When you're accessing an ODBC data source using the OpenResultset or Execute methods, there may be delays due to network traffic or heavy use of the remote server perhaps caused by your query. Rather than waiting indefinitely, use the QueryTimeout property to determine how long your application should wait before the QueryTimeout event is fired and your application trips a trappable error. At this point you have the option to continue waiting for another 'n' seconds as determined by the QueryTimeout property, or cancel the query in progress by using the Cancel argument in the QueryTimeout event procedure.

Setting this property to 0 disables the timer so your query will run indefinitely. Setting QueryTimeout to 0 is not recommended for synchronous operations as your application can be blocked for the entire duration of the query.

When used with an rdoConnection object, the QueryTimeout property specifies a global value for all queries associated with the data source.

When you use an rdoQuery object, the rdoConnection object's QueryTimeout property is used as a default value unless you specify a new value in the rdoQuery object's QueryTimeout property.

When working with asynchronous queries, the StillExecuting property remains True until the query completes, or the query timeout period is exhausted.

If the specified timeout exceeds the maximum timeout permitted by the data source, or is smaller than the minimum timeout, the driver substitutes that value and the following error is logged to the rdoErrors collection: SQLState 01S02: "Option value changed."