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.
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.
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.ConnectionSet MyConnection = New ADODB.ConnectionMyConnection.ConnectionTimeout = 90MyConnection.OpenSet MyConnection = New ADODB.Connection ' set strMyConnMyConnection.Open strMyConnSet myCommand = New ADODB.CommandSet myCommand.ActiveConnection = MyConnectionmyCommand.CommandTimeout = 90
At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.
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.
I'm assuming as this is a local copy of SQL/VS, that slow network/heavy usage is not an issue....
0
mkalmekAuthor Commented:
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
mkalmekAuthor Commented:
Tried the .udl method, but I get the same timeout when trying to select the db
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
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.