Program cannot connect to SQL server after migration

Tom Barnes 26 Reputation points
2022-01-05T16:00:45.607+00:00

We have an old 2008r2 server running SQL server express 10.50.4042.0 running an old human resources program that we only access once maybe twice/month.
I recently migrated this server (using azure migrate) to an Azure machine on a connected azure network.
I get an error, "[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied", when starting the program. FYI, The program is installed and running off the same server.

The server was migrated with same name, DNS updated to new address. It appears that when the program was originally installed that the sql connection was configured via ip address as the program will work and run when the old server (name changed, same old ip) is turned on. I have gone through all the program files searching for a config file and have come up empty handed. I assume the connection string was coded into the program files at the time of installation. I cannot re-install the program as the installation is password protected and the company has since gone under.

I thought i'd try using NAT on our firewall to redirect traffic from the old IP to the new server. This actually works while using SSMS. I can connect via SSMS from my PC using both the old IP and the NEW IP and server name. I can even RDP into the new server using the old ip address. I can ping the old ip from the server itself and my pc and the new server answers. But I still get the same error using the program. it cannot connect. I tried messing around with aliases to no avail, but the fact that SSMS can connect but the program cannot has got me perplexed. All credentials were transferred to the new SQL server and mirror the old. TCP/IP enabled, port 1433, currently have both old an new ip's under IP1 and IP2.

At my wits end. program has no export function. our only other alternative is to manually transfer information to spreadsheets. ugh.
Posting here as a last ditch effort.

SQL Server Other
{count} votes

2 answers

Sort by: Most helpful
  1. Tom Phillips 17,771 Reputation points
    2022-01-05T17:11:51.96+00:00

    It is impossible for to guess how an application stored the connection string to the server.

    You should be able to use a SQL Alias to repoint the server name to the new server name. The alias must be created on the client machine.

    See:
    https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/create-or-delete-a-server-alias-for-use-by-a-client?view=sql-server-ver15

    It is also possible the application verifies the version of SQL Server and will not connect unless it is a "supported" version. Most IBM applications do this.


  2. Tom Barnes 26 Reputation points
    2022-01-05T20:57:53.843+00:00

    When i discovered the SMSS could connect from our local network but not from our azure network i realized that there was something going on with the network address translation policy and not the server itself. All i needed was to be able to connect with a client and i would be fine. I was able to install a client on a local pc using windows vista SP2 compatability mode and it connects fine from the local network. problem solved.

    for anyone having similar problems in which you migrate a sql server to a new network but cannot access a client program's connections string that was configured via IP, my solution was to create a NAT policy on the router between our local LAN and the Azure WAN directing all traffic directed to the old server to the new server. you would think that since the old address is on the LAN that the traffic would never make it to the router, however, in my case it does.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.