Groups | Blog | Home
all groups > sql server programming > june 2004 >

sql server programming : VBscript Timed out


Dan Guzman
6/27/2004 10:00:14 PM
You can override the 30 second default timeout with the CommandTimeout
property of the ADO Command object.

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

rob
6/27/2004 10:42:52 PM
I have a dts package that contains a portion of VB script... every now and
then I get a timed out error message... any ideas ? Any way to increase
the time out within the vbscript ?


Dan Guzman
6/28/2004 8:15:36 AM
Connection.ConnectionTimeout, Connection.CommandTimeout and
Command.CommandTimeout properties are all read/write so you can display
values using the technique below.

Set connection = CreateObject("ADODB.Connection")
MsgBox connection.ConnectionTimeout

Note that ConnectionTimeout and CommandTimeout are different beasts. The
ConnectionTimeout specifies how ling ADO should wait for the connection to
be established, although the actual time may be longer depending on the
cause for the delay.

Connection.CommandTimeout specifies how long a command invoked via
Connection.Execute can run but Command objects to not inherit this setting.
You'll need to set the Command.CommandTimeout separately.

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

rob
6/28/2004 8:37:29 AM
Thanks Dan

I assume a command such as ADOcon.ConnectionTimeout = 60 will work for the
connection as well. Do you know how to return the Connection Timeout value
to a variable in VBscript ? I would like to display it in a message box
for testing purposes.

Rob

[quoted text, click to view]

rob
6/28/2004 9:51:21 AM
Thanks again Dan,

If an update is being run in the following fashion and is timing out, should
a Command object be established in its place ?

strSQL = "Update ....."
ADOcon.Execute strSQL




[quoted text, click to view]

Dan Guzman
6/28/2004 7:24:12 PM
You can either set the CommandTimeout property on the Connection object or
create a Command object and set the CommandTimeout property. Either method
will override the default timeout interval.

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

AddThis Social Bookmark Button