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

Timeout Expired

Status
Not open for further replies.

bongmarley

Programmer
Oct 21, 2002
74
CA
I am connecting to a sql database and when I run a page I get this error.
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E31)
[Microsoft][ODBC SQL Server Driver]Timeout expired

How can I change the length of the timeout.

 
Heres a connection (although to a access db)

<%
StrDBPath = Server.MapPath(&quot;db.mdb&quot;)
Set dbConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
dbConn.ConnectionTimeout = 120
--> dbconn.CommandTimeout = 120
dbConn.open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & StrDBPath & &quot;;&quot;
%>
 
What environment are you in that requires a longer timeout. It's very likely that you don't need a longer timeout, but rather need to resolve some problem with the connection and that no length of timeout will solve your problem (e.g. setting it to infinity will result in a very long debug cycle).
 
I tried using Server.ScriptTimeout[=NumSeconds]
but this does not solve my problem.
 
Again, are you using a DSN? Is the database on the same machine or the same network? What environment is this situation occuring in?
 
database is on same machine,
I am not using DSN

here is my connection string
Con.ConnectionString = &quot;Driver={SQL Server}; SERVER=test1;UID=; PWD=; DATABASE=test&quot;
 
If the database is on the same machine then it shouldn't be a matter of a timeout unless you have a really complicated query. If you run the same query by hand does it process it quickly?

I've never done a file-based connection to SQL Server before, but I'm ignorant of whether or not you can. Is there a reason you're not using a DSN?
 
if ur on DSN
Start-->Settings-->Control Pannel-->Administrative Tools--> ODBC
in ODBC [System Tab] --> Configure--> [Options>>] --> PageTimout
set it to whatever u want
All the Best!
 
I can run this page and it works when I connect to an acess database, with the same code(of course the small changes like the connection string etc.) but it wont run when I connect to sql server.
 
Also on the page I retrieve names out of a multiple select box and run a report on them. if I select one or two it works but if i select a large amount I get the timeout error.
 
How about posting the code that performs the retrieval along with some info about the structure of the table. Perhaps we can help with more information.
 
Here is the update code:
con.execute(&quot;Update DaysTaughtAndClaimed set recdate='&quot;&request(&quot;recdate&quot;&getrec(&quot;id&quot;))&&quot;',Reason='&quot;&Replace(NewReason(&quot;Description&quot;),&quot;'&quot;,&quot;''&quot;)&&quot;', ReasonCode=&quot;&NewReason(&quot;Code&quot;)&&quot;, sub1Payrate='&quot;&request(&quot;sub1Payrate&quot;&getrec(&quot;id&quot;))&&quot;', sub1percentageofday=&quot;&request(&quot;sub1perecnt&quot;&getrec(&quot;id&quot;))&&quot;, PercentageOfDay=&quot;&request(&quot;perecnt&quot;&getrec(&quot;id&quot;))&&quot;, PortionOfDay='&quot;&request(&quot;portion&quot;&getrec(&quot;id&quot;))&&quot;',ReasonType='&quot;&getRType(&quot;ClaimableorUnclaimable&quot;)&&quot;/&quot;&getRType(&quot;WithpayorWithoutpay&quot;)&&quot;' where id=&quot;&getrec(&quot;id&quot;))

basically i create a report that retrieve records from the database. I store the info in textboxes with the name of the field and the id of that record. Here they can make changes and then update to the table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top