Classic ASP page - DB connection Timeout issue
Posted on 2011-09-30
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.