Contents   Index   Previous   Next



Error when using MS SQL Server "Named Pipes Provider: Could not open a connection to SQL Server"

To fix this issue you might have to execute all the following four methods (from A to D), but you might also have to execute only method of these.

A. To enabled Named Pipes and TCP/IP protocols on the database server, execute the following steps:

         1. Start → All Programs → Microsoft SQL Server 2005 → SQL Server Configuration Manager

         2. In the left hand pane, expand "SQL Server Configuration Manager (Local) → SQL Server 2005 Network Configuration"

         3. In the left hand pane, highlight "Protocols for SQLEXPRESS"

         4. In the right hand pane, right click "Named Pipes" and select "Enable"

         5. In the right hand pane, right click "TCP/IP", select "Enable" and then select "Properties"

         6. On the "IP Addresses" tab ensure that "Enabled" is set to "Yes" for each network adapter listed.

         7. Click [OK] to close the TCP/IP Properties dialog.

         8. In the left hand pane select "SQL Server 2005 Services"

         9. Right click "SQL Server (SQL EXPRESS)" and select "Restart"

Whilst it is not required for this process, it can make the task of configuring remote access to SQL Server Express easier if you also start the process "SQL Server Browser". You may need to open the properties and on the "Service" tab change the Start Mode from Disabled to Automatic, before you can start the process.

 

B. Add SQL Server 2005 Express as an exception to the windows firewall. You will need to add SQL Server 2005 Express as an exception to any firewall software that is running locally. The following sequence assumes the Windows XP Firewall:

         1. Start → Control Panel (classic view) → Windows Firewall

         2. On the Exceptions tab, click "Add Program..."

         3. Browse to "sqlserver.exe" and click [OK]. This is normally located in the folder "Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn"

         4. Repeat for "sqlbrowser.exe" if you have set the "SQL Server Browser" service to run. This is normally located in the folder "Program Files\Microsoft SQL Server\90\Shared"

         5. Click [OK] to close the Windows Firewall dialog.

If you still find that you cannot connect, then try opening TCP Port 1666 in the Windows Firewall:

         1. Start → Control Panel (classic view) → Windows Firewall

         2. On the Exceptions tab, click "Add Port..."

         3. The "Name" can be anything, but I suggest something like "TCP Port 1666 for SQL Server". For the "Port number" enter 1666, and ensure that TCP is selected. Click [OK]

         4. Click [OK] to close the Windows Firewall dialog.

For those that are interested, the port number 1666 comes from the "TCP Dynamic Ports" displayed on the "IP Addresses" tab of the "TCP/IP Properties" of the TCP/IP Protocol listed by SQL Server Configuration Manager.

If you get this error when trying to connect using Microsoft SQL Server Management Studio then try opening UDP port 1434.

 

C. Ensure that the SQL Server 2005 Express server process is running.

      Check this by:

         1. Start → Control Panel (classic view) → Administrative Tools → Services

         2. Scroll down and check that "SQL Server (SQLEXPRESS)" has the status of "Started". Start it if it is not already started.

 

D. Ensure that the SQL that the built-in account of the local system is used:

         1. Start SQL Server Configuration Manager

         2. Right-click on the SQL server name that you created

         3. Select 'Properties'

         4. On the Log On tab, set the option Log on as: to

                    "Built in account, Local System"

         5. Restart Service and close Sql Server Config Mgr