Solved

TCP Provider Run Time Error

Posted on 2013-01-08
7
504 Views
Last Modified: 2013-01-16
screenshot of the Run time error
I have a VB6 app that has been running for 2 years and suddenly out of the blue i got this weird error.   Do you guys have any idea about the runtime error?

The application is made from VB6 with SQL Server 2005 database.

Below is the connection string I am using.
Public Sub Open_Connection()
  Set con = New ADODB.Connection
  With con
    .ConnectionString = "Provider=SQLNCLI;Server=xx.xxx.xxx.xx\instance;Database=myDbase;Uid=admin; Pwd=myPword1234;"
    .CommandTimeout = 0
    .CursorLocation = adUseClient
    .Open
  End With
End Sub

Open in new window


Any help is greatly appreciated.

-m3mdicl
0
Comment
Question by:m3mdicl
  • 4
  • 2
7 Comments
 
LVL 25

Expert Comment

by:TempDBA
ID: 38758328
You need to check folllowing two things:-
1. Is your login + password is correct and there exists a valid login in the server.
2. Is the firewall opened.

•Remote OLEDB connection using TCP to a server that is blocked by Firewall
HResult 0x274C, Level 16, State 1
TCP Provider: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Error: Microsoft SQL Native Client : An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections..
Error: Microsoft SQL Native Client : Login timeout expired.

Ref:- http://blogs.msdn.com/b/sql_protocols/archive/2005/09/28/474698.aspx?PageIndex=11
0
 
LVL 9

Expert Comment

by:shorvath
ID: 38759742
You are using an IP address in your connection string.

Has the IP address of this server cahnged? Are you using DHCP?  Can you PING the server using this IP from the client machine that is generating the error?

It is always best to use a named server and let your DNS/Hosts files resolve IP addresses.
0
 

Author Comment

by:m3mdicl
ID: 38759962
Hi everyone!!! Thanks for the quick reply.

As I've said the app is running for 2 years with no problem.  
Some additional info.

* The IP address is STATIC.
* The username and password is correct (didn't make any changes)
* The firewall is not blocking the app

Any more suggestions?
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

Author Comment

by:m3mdicl
ID: 38760006
Hi,
 The ip-address of the connection string has not changed. I can ping the server fine. The firewall is open for the traffic, the sql browser service is running. I can connect using the application from my home office.  I am kind of stumped on why this is happening.  Any ideas?
0
 
LVL 9

Expert Comment

by:shorvath
ID: 38760186
Check the Event Viewer to see if there is any more info on why the SQL is rejecting to connection.  (I have had a similar situation caused by a Windows Update.. )  Also check to see if anything has been done to the Server/SQL in terms of changes - new software, updates etc.
0
 

Accepted Solution

by:
m3mdicl earned 0 total points
ID: 38767971
Nothing has been done to the SQL server in terms of updates. What we did was
add xxx.xx.xx.xxx./abc,1433 in the connection string and could get it to work.
0
 

Author Closing Comment

by:m3mdicl
ID: 38781996
None of the responses helped.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

920 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

17 Experts available now in Live!

Get 1:1 Help Now