Error: Named Pipes Provider Error 40 - Could Not Open A Connection To SQL Server
- Open the SQL Configuration Manager
- Enable TCP\IP and Named Pipes
- Restart the SQL service
- Make sure the SQL Server Browser is running, if it is disabled you cannot connect even if you have allowed connections in SQL
- To get the SQL Server Browser running if it is disabled: Right-click on the service and select Properties > Change Startup Type to Automatic
- If you have issues running as a domain account, set to local system and that should be fine, then restart the Service
This is an excerpt from an article on troubleshooting SQL Server Connection errors. See the link below for the entire article:
https://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/ The most common reasons for this error can be resolved using the one or more of the steps below. For a complete list of steps see the link above.