Solved

[Microsoft][ODBC SQL Server Driver]Timeout expired

Posted on 2003-10-28
9
133,194 Views
Last Modified: 2011-08-18
When I run an online report sometimes I get the following error pointing to my ASP page
How can I stop this from happening....This happens when the user requests lots of data.
Is there any way to make the time unlimited?


Microsoft OLE DB Provider for ODBC Drivers (0x80040E31)
[Microsoft][ODBC SQL Server Driver]Timeout expired
0
Comment
Question by:AutomaticSlim
9 Comments
 
LVL 15

Expert Comment

by:SRigney
ID: 9635536
There is a connection timeout and a CommandTimeout property that both have default values of 60 seconds.  You probably need to modify the CommandTimeout to be longer.
0
 

Author Comment

by:AutomaticSlim
ID: 9635731
How do I do this?
0
 
LVL 9

Accepted Solution

by:
apirnia earned 70 total points
ID: 9636001

objConn=Server.CreateObject ("ADODB.connection")
  objConn.ConnectionTimeout = 0
  objConn.CommandTimeout = 0
objConn.open

This should do....

There is another place in IIS to change timeouts but I think your problem is this one.....
0
 
LVL 35

Expert Comment

by:David Todd
ID: 9636017
Hi,

I'd recommend _against_ making it unlimited.

Try timing it and then set the timeout to twice the longest time you get. The timeout is in there for a reason.

Alternatively, reconsider how much data you let the user select in any one report or batch.

Maybe both are needed.

Regards
  David
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 9

Expert Comment

by:apirnia
ID: 9636117
Yes true.... above is just a code for what you need to do....... use 0 just for testing.

In a simple description the reason the Timeout is there is because some end users don't have patience. They see that the report is taking a long time so they click on refresh again and again not knowing that it is has lots of data. This backs up the SQL server. and when you have it set to 0 it will run all the way. When you have Timeout it kills it if it is taking to long
0
 
LVL 13

Expert Comment

by:MikeWalsh
ID: 9636477
Those solutions should help with the actual timeout problem.

I would suggest spending some time and looking at the underlying cause of the timeout problem. Look at the performance of your server, look at the amount of data being sent, look at the way in which the data is being rounded up. Are your queries the most efficient, is there a lot of activity on your server? How are your indexes arranged, is there another way to write your queries, etc. etc.

Increasing the timeout will just stop the timeout from happening after the default, but your users will still have to wait that much time for the report to generate, 60 seconds is a lifetime to some users out there ;)
0
 

Expert Comment

by:anok999
ID: 11230490
My problem is even in sql environment i.e right click on table goto query and run some simpale qry like col03=so and so even then i am getting ODBC Driver time out for SQL
0
 

Expert Comment

by:oakes3
ID: 12957006
I don't know if you've solved this yet - but I just had the same problem on an Access XP form hitting a SQL 2000 box.  Only one table was timing out, and only on updates and inserts (the data displayed OK on the form)...

Update on linked table "tblCustomer" failed.  [ODBC SQL Server Driver] Timeout Expired (0)"

Recreating the table from scratch, a little bit at a time, uncovered the problem: three (3) ntext fields.  Changing these to nvarchar(4000) solved the problem.  Changing them back to ntext confirmed that this was indeed the issue.  

0
 

Expert Comment

by:xstaxjke
ID: 13573964
I had a similar issue but with a much smaller database.

In the end I had to copy the database to a new name and update my site accordingly. Apparently the table was somehow damaged. I had already tried compact and repair and it made no difference. This is probably not a guaranteed fix but using the answer above only caused the page to never load.
0

Featured Post

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Join & Write a Comment

When you hear the word proxy, you may become apprehensive. This article will help you to understand Proxy and when it is useful. Let's talk Proxy for SQL Server. (Not in terms of Internet access.) Typically, you'll run into this type of problem w…
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now