?
Solved

SQL Server Timeout Issue

Posted on 2011-03-03
13
Medium Priority
?
1,122 Views
Last Modified: 2012-06-22
I am trying to debug an app on my machine which is running Windows 7 64, MS SQL 2008 Developer Edition and Visual Studio 2008.

When I try to make a connection through VB to the SQL database I kept getting a timeout error.  After trying a number of things I then tried to make an ODBC connection to the SQL DB and got the same timeout error - HYT00.

I have checked that all SQL and associated services are running, "Shared Memory", "TCP/IP" and "Named Pipes" are all enabled but I am out of ideas.  I have tried calling the machine by its name, its IP address and '.' none of which make any difference.

I use SQL Server authentication to log into my DB and am happily able to log in and to work on my db through SQL Management Studio using the same login I am trying for ODBC.

Any ideas?

Thanks
0
Comment
Question by:mkalmek
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +1
13 Comments
 
LVL 11

Expert Comment

by:rajvja
ID: 35024995
Hi

Can you try configuring a data source in design view and check the Test Connection. If succeeds, try to copy the connectionstring and use the same in your application.
0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35025007
Within ADO, the developer can set:

   1. connection timeout (default 15 seconds)
        if the connection cannot be established within the timeframe specified
   2. command timeout (default 30 seconds)
        cancellation of the executing command for the connection if it does not respond within the specified time.


These properties also support a value of zero, representing an indefinite wait.

Here is some example code:

Dim MyConnection as ADODB.Connection

Set MyConnection = New ADODB.Connection

MyConnection.ConnectionTimeout = 90

MyConnection.Open

Set MyConnection = New ADODB.Connection 
 ' set strMyConn

MyConnection.Open strMyConn

Set myCommand = New ADODB.Command

Set myCommand.ActiveConnection = MyConnection

myCommand.CommandTimeout = 90

Open in new window

0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35025041
you also try changing the request time out in page by:-

  Server.ScriptTimeout = 1800 ' in seconds 

Open in new window


on page load.
       
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35025047
following article may be helpful:-

http://vyaskn.tripod.com/watch_your_timeouts.htm
0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35025054
another artilce which may be helpful:-

http://vyaskn.tripod.com/sql_odbc_timeout_expired.htm
0
 
LVL 11

Expert Comment

by:rajvja
ID: 35025485
Hi,

  Increasing the timeout is not good solution. Try to find the reason for timeout.
0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 35025501
A nice approach I use a lot is to create a new txt file on your desktop, and once it is created, replace the txt extension with udl.

You can then double click this udl file, and create your connection properties using the familiar wizard.

Hopefully you can play around with all of the providers listed etc, and other connection properties until your connection is successful.

If you then save and re-open the udl file in a text editor, it will show you the connectionstring you need to use within VS.

If you can't connect using any of the providers, then you definitely have something configured wrong in server configuration manager.

I hope this helps.

L
0
 
LVL 9

Expert Comment

by:mayank_joshi
ID: 35025604
rajvja, i know that increasing the time out is not a good solution
but sometimes in case of large database, heavy operations or slow network
it can be changed  for a particular task to suit our requirements.

0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 35025609
I'm assuming as this is a local copy of SQL/VS, that slow network/heavy usage is not an issue....
0
 

Author Comment

by:mkalmek
ID: 35031449
Everything is local, there is no network or heavy usage and the db is very small.  I have tried fiddling with the timeout anyway but it makes no difference
0
 

Author Comment

by:mkalmek
ID: 35031509
Tried the .udl method, but I get the same timeout when trying to select the db
0
 
LVL 7

Accepted Solution

by:
lozzamoore earned 2000 total points
ID: 35034975
Is this using ODBC still?

Just out of interest, why do you want to use ODBC? It is quite an old protocol.

Does the UDL connection still time-out if you pick the MS OLE DB Provider for SQL Server?

Thanks,
0
 
LVL 7

Expert Comment

by:lozzamoore
ID: 35035128
It may also be worth downloading the latest OleDB and ODBC Drivers for SQL 2008 from here:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c6c3e9ef-ba29-4a43-8d69-a2bed18fe73c

Regards,
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
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, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

770 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