Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timeout Expires, even when timeout is 3600 1

Status
Not open for further replies.

BB101

Programmer
May 23, 2001
337
GB
I am having some real problems with MSSQL2K and ASP (VBScript).


I have the following connection string:
oCon.Open "Provider=SQLOLEDB;Server=" & Session("ServName") & ";Database=" & Session("DbName") & ";User ID=" & Session("UserName") & ";Password=" & Session("UserPwd") & "; Connect Timeout=3600"

However, a few seconds into the script execution, it timesout with the error:
Microsoft OLE DB Provider for SQL Server error '80040e31'
Timeout expired
/ipc_dev/CloseRevisionAction.asp, line 79

The ASP has a timeout value of 3600, and so does the connection. I know the stored procedure runs fine, and it does take a while (copy databases, large scale updates etc).

Does anyone know how I can stop this annoyance? --BB
 
The way I solved this was using the following code in my asp script relating to the command object

set objcommand = server.createobject("adodb.command")
objcommand.commandtimeout=0'############## this ensures no timeout as the sp takes a minute or so to run
objcommand.activeconnection = dbconnection
objcommand.CommandText = "sp_yourspname"
objcommand.CommandType = adCmdStoredProc

HTH

Andy
 
Thanks, that what I needed --BB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top