ADO CommandTimeout Property

Definition and Usage

The CommandTimeout property can be set or returned to specify the time to wait before terminating the attempt and generating an error during the execution of a command. The default value is 30.

Syntax

object.CommandTimeout

Example

For Command Object:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
set comm=Server.CreateObject("ADODB.Command")
comm.CommandTimeout=10
response.write(comm.CommandTimeout)
conn.close
%>

For Connection Object:

<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
conn.CommandTimeout=10
response.write(conn.CommandTimeout)
conn.close
%>