Link to home
Start Free TrialLog in
Avatar of Uugeman
Uugeman

asked on

Timeout expired

All,

I am running a Stored Procedure from a Web Page and I continually get the following error.

Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E31)
[Microsoft][ODBC SQL Server Driver]Timeout expired
/OMSEDD/inc/vbsubs.inc, line 7

VBsubs.inc - Creates My recordset.
------------------------------------------------------------------------
<%
Sub LoadRecordSet(rstRecordset, strSQLStatement)
      SET cmdSP = CreateObject("ADODB.Command")
      cmdSP.CommandText = strSQLStatement
      cmdSP.ActiveConnection = cnnGlobalConnection
      SET rstRecordset= CreateObject("ADODB.Recordset")
      SET rstRecordset= cmdSP.Execute
End Sub
%>
---------------------------------------------------------------------------
Connection  - Creates My connection object.
------------------------------------------------------------------------
<%
Sub OpenConnection
      Set cnnGlobalConnection = Server.CreateObject("ADODB.Connection")
      cnnGlobalConnection.ConnectionString = "driver={SQL Server};server=SNORSQLTEST02;uid=webaccess;pwd=webconnect;database=OMSEDD"
      cnnGlobalConnection.CommandTimeout = 0
      cnnGlobalConnection.ConnectionTimeout = 0
      cnnGlobalConnection.Open
      End Sub
%>
-----------------------------------------------------------------------------

Can anyone explain to me why I am getting a timeout and how I can fix it?

Thanks
ASKER CERTIFIED SOLUTION
Avatar of YZlat
YZlat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
in case the problem is not your asp script, try optimizing your sql query by adding WHERE clause and make sure your table has a primary key
also you can try modifying the following keys in the registry:

HKLM/p2pLog/p2pLog/1.0/dbaccess/CommandTimeout
HKLM/p2pLog/p2pLog/1.0/dbaccess/ConnectionTimeout

the above are set to 300 by default