12

I used to have a desktop application pointing to a Sybase database through an .ini file that had this connection string:

 CONNECTION_NAME = "DSN="Dna_Name";UID="User";PWD="Password""

It worked perfectly.

A few days ago the database has been migrated to SQL Server 2008 R2 and I need to update the .ini file to redirect the new production server. I updated the connection string as follow:

CONNECTION_NAME = "Provider=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog="CatalogName";Data Source="Production_DNS""

But I'm getting the following error:

Named Pipe Provider: Could not open a connection to SQL Server [53]

Additional notes:

  • Production DNS is working perfectly in other IT areas and other apps are reaching the server without troubles.
  • I'm trying to connect from dev box.
  • The application is an inherited implementation with several years, that's why the *.ini file needs to be kept around.

I've some hours browsing internet for error details with almost no results.

Does the new connection string seems correct?. Any idea of what can be generating the error? Recommendations?

Thanks in advance,

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
G21
  • 1,297
  • 2
  • 18
  • 39
  • 1
    I faced such an error before, it was just because wrong port number, as you might know, default port for default SQL instance is 1433, but it is changeable through `Start Menu > SQL Server configuration Manager` in the left pane, select `SQL Server Connections`, from there you have access to SQL instances, select one of them, hit one of them and from right pane double click `TCP/IP`, on the second tab named `IP Addresses` you can see the `TCP port`, in my case I changed it to the true port number. – Muhammad Musavi Apr 11 '18 at 10:23
  • Related posts - [How do I fix the error 'Named Pipes Provider, error 40 - Could not open a connection to' SQL Server'?](https://stackoverflow.com/q/9945409/465053) & [error: 40 - Could not open a connection to SQL Server](https://stackoverflow.com/q/30392974/465053) – RBT Apr 13 '19 at 01:33

2 Answers2

12

Fortunately after digging around for several hours I have been told there is a production DNS error that was causing my issue.

I fixed the issue by providing the server name on the Data Source connection attribue as follow:

CONNECTION_NAME = "Provider=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog="CatalogName";Data Source="Production_Server_Name;""

Tip: to avoid errors on server name you can check it out through SQL Server Management Studio by executing the following T-SQL:

SELECT @@servername
G21
  • 1,297
  • 2
  • 18
  • 39
  • I had the same error and the root cause was also a DNS issue. The connection string was correct but the wrong server was inside a cross-database query. – 0xced Nov 03 '20 at 22:24
-1

You are probably pointing to the wrong server. I got same error pointing to a linux server.

profimedica
  • 2,716
  • 31
  • 41
  • I'm facing this same issue, but only with one particular report. I have another report using the exact same data source that works perfectly fine but for some this one report in particular throws a 53 error. – Asher Jun 01 '18 at 08:40