ONE Active Server Pages Product Home Page Developer Site Version


ADO Command Object CommandTimeout Property

How long to wait while executing a command before terminating the attempt and generating an error.

CommandTimeout Property Return Values (ADO Command Object)

Sets or returns a Long value that specifies, in seconds, how long to wait for a command to execute. Default is 30.

CommandTimeout Property Remarks (ADO Command Object)

Use the CommandTimeout property on a Command object to allow the cancellation of an ADO Command Object Execute Method call due to delays from network traffic or heavy server use. If the interval set in the CommandTimeout property elapses before the command completes execution, an error occurs and ADO cancels the command. If you set the property to zero, ADO will wait indefinitely until the execution is complete. Make sure the provider and data source to which you are writing code supports the CommandTimeout functionality.

The CommandTimeout setting on a Connection object has no effect on the CommandTimeout setting on a Command object on the same Connection; that is, the Command object's CommandTimeout property does not inherit the value of the Connection object's CommandTimeout value.

CommandTimeout Property Examples (ADO Command Object)

See the ActiveConnection property.