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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script timed out

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
US
I have an asp page which works correctly. I moved to a new IIS box, still same setup and version, which is faster. I set the session timeout to 10 minutes, and the ASP script timpout to 180 sec in IIS. I even added this asp to try and help:
Code:
<% Server.ScriptTimeout=180 %>
...
...
Set cnnGetRows = Server.CreateObject("ADODB.Connection")
cnnGetRows.CommandTimeout=120
cnnGetRows.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("/reg/Regdb/MSDB.mdb")
Set rstGetRows = cnnGetRows.Execute("[i]SQL statement[/i];")
arrDBData = rstGetRows.GetRows()

It seems to time out around 20 seconds. Where else can i check/change this? I put a response.flush in my code and its looping, but just craps out after 15-30 seconds.
 
What I've had to do was set the "OLE DB Services" property to a value of -2. Once I did this, the connection timeout went away.

Might want to give that a try.
 
cnnGetRows.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath ("/reg/Regdb/MSDB.mdb") & ";OLE DB Services=-2"

Hope this works for you.
 
I tried, still no luck. I thought i would switch connections to see if that would help, it pulls more records, but still about 20 seconds to timeout. I removed the SQL since it's pretty long and clutters up this post.

Code:
Set Conn = CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath ("/reg/Regdb/MSDB.mdb")
Conn.mode = 3
Conn.open strCon
Set rs = Server.CreateObject("ADODB.Recordset")

SQL="....."
rs.open SQL,Conn,0,2,1
	arrDBData = rs.GetRows()
rs.close

Any suggestions??
 
Check the Timeout settings on the SQL Server Property page (i.e. configuration).
 
You mean:

Website Name > Home Directory > Configuration > Options

I changed the session to 10 minutes, and the ASP script to 180 seconds.
 
I should have said, i already changed those, but still the same thing. Ideas?
 
Anyone have some other thoughts? I still can't get it to work. If IIS has a value, and the ASP has a value. Could setting it in the Jet connection to DB be the answer???
 
I have had a similar issue and I believe it was the .CommandTimeout setting that finally appeared to work for me. I'll try to review that particular piece again in the morning (provided I remember, which is a trick these days) and see if I can provide exactly what I used. I do remember that the Server.ScriptTimeout as well as the IIS settings did not fix the issue for me.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Yep, it was the conn.CommandTimeout (where conn represents the connection object). I set it = 0, which means that it should run until it finishes (instead of timing out) and haven't had any problems with it yet (but it's only been in use for a couple of months).

Hope that helps...

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
I tried that but it didn't work. Maybe I don' thave it right??

Code:
Response.AddHeader "pragma", "no-cache"
Response.AddHeader "cache-control", "private" 'pStr
Response.CacheControl="Public"

Set Conn = CreateObject("ADODB.Connection")
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="& Server.MapPath ("/reg/Regdb/MSDB.mdb")
Conn.mode = 3 
Conn.CommandTimeout=0
Conn.open strCon

Set rs = Server.CreateObject("ADODB.Recordset")
 
Hmm, missed that you were working with Access... I know that it will work with SQL Server but not sure about Access... Perhaps an Access guru here can better address that or you might try one of the Access forums to see if there is an answer... Sorry. :-(

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
It seems to grab the info from the DB quickly. But i am looping to display a listing of records, so i think the issue is in ASP. I may have to start from scratch on this.
 
In other words, you're getting your data ok, but it's timing out while trying to display?

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Yes, that's why it has to be an ASP thing. Lots of records to go through and totals to figure before displaying
 
The only way to go through that would be to review the ASP code. If you want to do so, it might be best to start another thread.

------------------------------------------------------------------------------------------------------------------------
"Men occasionally stumble over the truth, but most of them pick themselves up and hurry off as if nothing ever happened."
- Winston Churchill
 
Good idea, i'll wait a few days to move this one out. Thanks for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top