Solved

Getting time out error running a query on SQL Server 2000 DB from VB

Posted on 2003-11-12
5
412 Views
Last Modified: 2008-03-06
I'm working on an application in VB environment. The database that I'm using is of MS SQL Server 2000. When I run the application it often happens that running any complicated or large query from VB gives timeout error, whereas running the same query using Query Analyzer of MS SQL Server 2000 works although it takes some time. How can I get rid of it?
0
Comment
Question by:saclain
  • 2
5 Comments
 
LVL 75

Accepted Solution

by:
Anthony Perkins earned 125 total points
ID: 9737315
The difference is that Query Analyzer does not have a timeout and ADO has a default timeout of 30 seconds.  So depending how you are executing the SQL statement you need to either increase the CommandTimeout property or set it to 0 (infinite) to be the same as Query Analyzer.

And of course the better answer is to analyze why it is taking so long in the first place.

Anthony
0
 

Expert Comment

by:kauf
ID: 9744075
You can set the ADO timeout if you steer your query through several objects.

Try this:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdaexamples_vb01_4.asp
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 10143264
Do you need any more help?
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

726 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