Name

ConnectionTimeout (Connection Object) — objConn .ConnectionTimeout (= lngNumSeconds )

Synopsis

Sets or retrieves the number of seconds ADO will wait while attempting to establish a connection before raising an error. The default value for this property is 15 seconds.

Parameters

lngNumSeconds

A long that represents the number of seconds ADO will wait while attempting to establish a connection to the underlying data provider.

Example

For an example of the ConnectionTimeout property, see the code example for the ConnectionString property.

Notes

You can instruct ADO to wait indefinitely for the connection to the underlying data provider to be established by setting the value of the ConnectionTimeout property to 0.

Note, however, that it is imperative to remember the current setting of the Server object's ScriptTimeout property. (The default of the ScriptTimeout property is 90 seconds.) For example, suppose the ScriptTimeout is set to 30 seconds and the ConnectionTimeout for the Connection object on an active server page is set to 45 seconds. You may not be able to see the result of attempting to establish a connection to the underlying data provider regardless of success or failure.

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.