SQL SERVER connectivity error: SQL Server does not exist or access denied

Recently I was troubleshooting a connectivity issue in a development environment from an application. The application was using the connection string as

“Provider=sqloledb;Data Source=myserver\instance1,1433;Network=DBMSSOCN;Initial Catalog=mydb;Integrated Security=SSPI;”

I was able to connect to the SQL SERVER from SSMS, however when connecting from an application it was throwing the error

[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied

This is very generic one and can happen due to many reasons like

(1) Account may not have access or password might be wrong
(2) Connection might be blocked by a firewall
(3) Since it is a named instance, the port might be different. In some cases it might be dynamic also, for which the SQL Server Browser service should be up and running.

Looking at the connection string, everything looked good except for the “Network”. I had no idea of what it is. Googling led me to this KB article from Microsoft which clearly explains what it is.

Basically when an application is trying to connect to SQL SERVER, if one protocol fails then it tries to connect with another protocol. Example, assuming TCP/IP is enabled as primary and Named Pipes as secondary. When an application tries to connect to SQL SERVER, it first tries with TCP/IP. If that did not succeed, it tries with Named Pipes. If that also fails, then only it throws the error.

However, we can force the application to use only one protocol and that is done by the “Network” keyword in the connection string. This article defines all the options available for “Network”.

In my case the option “DBMSSOCN” corresponds to TCP/IP and it was disabled in the development machine. Enabling it, using this article, fixed the issue.

About these ads

About Suresh Kumar D

Hardcore SQL Developer and aspiring Database Architect.
This entry was posted in SQL SERVER. Bookmark the permalink.

One Response to SQL SERVER connectivity error: SQL Server does not exist or access denied

  1. Prosper says:

    Hi,
    Thanks for the hint, I was unable to access the SQL Server instance on the remote PCs, but I am able to do that now, but when I’m trying to use the remote computers to access the Database Name, I get the following error

    “Unable to connect to server “PastelServer\SQLEXPRESS”. Reason:[DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied.

    I don’t know what else that could be the problem.

    Please Assist, thanks.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s