One of the most common errors one may encounter when connecting to SQL Server is Error 40 could not open a connection to SQL server. The error is very clear and is that a connection can’t be made to SQL Server. In order to troubleshoot it, follow below steps.
– First step is to check windows application logs or SQL Server error logs for any specific error and verify that SQL server services are running and a local connection to SQL Server is possible.
– Second step is to ping the SQL Server from the remote computer to check network connectivity between SQL Server and the remote computer.
– Third step is to check that SQL Server port is not being blocked by firewall. To add an exception for SQL Server port in firewall, type firewall.cpl in run command window and follow the instructions given here
– The next step is to check whether SQL Server allows remote connections or not. To verify this, connect to Object Explore in SQL Server Management Studio, right click on server node and select properties. This will open the Server properties dialog box. In server properties dialog select connections on left hand pane. Check the option “Allow remote connections to this SQL
– Server” and click Ok.