Increase the Timeout in a Query

Hi,

I need to execute a query from VBscript to a SQL Server View, but the problem is that the Timeout error is displayed when I execute this query. So I need to increase the timeout to execute the query. I need to know if it is possible to increase this timeout for all queries into the SQL Server or if it is not possible how I can increase this timeout into the vbscript ( I am using a Recordset and so I need to increase the timeout over the Connection object).

Thanks.
mayojmAsked:
Who is Participating?
 
rherguthConnect With a Mentor Commented:
Dim oConn
Set oConn = CreateObject("ADODB.Connection")
oConn.CommandTimeout = 120
oConn.Open ""      ' Your connection string

The default timeout is 30 seconds.
0
 
rbolchozCommented:
To set the timeout in VBScript in an ASP page use

Server.ScriptTimeout = numSeconds

The default is 90 seconds
0
 
rbolchozCommented:
Does this answer your question?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
walterecookCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: rbolchoz {http:#8249018}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

walterecook
EE Cleanup Volunteer
0
 
rherguthCommented:
walterecook,
Thanks for all your cleanup activities.

>> I need to increase the timeout over the Connection object

Please split the points since I answered the question and rbolchoz answered what was probably the next issue mayojm would have had with ASP's timeout after lengthening the ADODB connection timeout.

I know, It's only 10 points, but hey!

Thanks
0
 
walterecookCommented:
I missed your 'set it  it to 120' line
Sorry about that.

MOD
change the recommdation to
accept rherguth
0
All Courses

From novice to tech pro — start learning today.