nachtmsk
asked on
Classic ASP page - DB connection Timeout issue
Hi,
I am maintaining some old ASP code that I did not write. I am a programmer and a DB admin but I am not very familiar with ASP.
Here is the situation:
I have a web page that runs a query to SQL 2005. If the query returns 5 or 10 records it's fine. If it returns a large number, (1000), then I get the following error message on my browser:
----
Microsoft OLE DB Provider for ODBC Drivers error '80040e31'
[Microsoft][ODBC SQL Server Driver]Timeout expired
/utility/search_script.asp , line 201
-----
LINE 201 is below...
Set UserNames = Server.Createobject("ADODB .Recordset ")
LINE 201 --> UserNames.Open sqlq, Connect ,adopenstatic, adlockreadonly
If I run the same query in a SQL command line I get no problems returning the data.
So my question is:
Is the timeout issue an ASP script problem or an ODBC problem?
Suggestions please on how to fix this. The entire script is about 400 lines long, which is why I didn't post the whole thing. But I can post additional pieces of it if need be.
Thanks!
I am maintaining some old ASP code that I did not write. I am a programmer and a DB admin but I am not very familiar with ASP.
Here is the situation:
I have a web page that runs a query to SQL 2005. If the query returns 5 or 10 records it's fine. If it returns a large number, (1000), then I get the following error message on my browser:
----
Microsoft OLE DB Provider for ODBC Drivers error '80040e31'
[Microsoft][ODBC SQL Server Driver]Timeout expired
/utility/search_script.asp
-----
LINE 201 is below...
Set UserNames = Server.Createobject("ADODB
LINE 201 --> UserNames.Open sqlq, Connect ,adopenstatic, adlockreadonly
If I run the same query in a SQL command line I get no problems returning the data.
So my question is:
Is the timeout issue an ASP script problem or an ODBC problem?
Suggestions please on how to fix this. The entire script is about 400 lines long, which is why I didn't post the whole thing. But I can post additional pieces of it if need be.
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the comments.
In my case, Jacko72's answer was correct. I looked at the sql statement that was being passed. It was different then I thought it was. It was joining on 4 tables. Anyway, the SQL is what was timing out. Thanks!
M
In my case, Jacko72's answer was correct. I looked at the sql statement that was being passed. It was different then I thought it was. It was joining on 4 tables. Anyway, the SQL is what was timing out. Thanks!
M
ASKER
Thanks!
<%
Server.ScriptTimeout = 180
%>
in asp code