Free Information Technology Magazines and eBooks

Monday, June 07, 2010

SQL Error 40: Could not open a connection to SQL Server, Error 1326

When connecting to a newly installed SQL Server 2005, an error appeared "(provider: Named Pipes Provider, error: 40 – Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 1326)", which in layman's term means, the client PC cannot establish a connection to the database server. There could be more that one reason why such error is encountered. One possible reason is a restriction from the Windows firewall where the SQL server was installed. You can fix this by adding the port 1433 on the exceptions (control panel > Firewall Settings > Exceptions > Add Port).

Another possible reason why you can't open a connection is a disabled TCP/IP and/or Name Pipes protocols. To check if these protocols are enabled, follow these steps:
1. Go to Microsoft SQL Server 2005 > Configuration Tools > SQL Server Configuration Manager.
2. From SSCM, click SQL Server 2005 Network Configuration > Protocols for MS SQL Server.
3. Now check if the status of TCP/IP and Name Pipes protocols are enabled. If not, enable it accordingly by right-clicking on it and choose Enable from the context menu.

SQL Error 40: Could not open a connection to SQL Server, Error 1326
(Take Note: You can also do the same for SQL Native Clients)

4. Restart the SQL Server Service.

To stay up-to-date on SQL Server Tips, subscribe now.

0 comments: