I spent almost all morning tracking down a problem where an ASP.NET app would not connect to my Microsoft SQL server. It turns out that the solution I found also applies to failing ColdFusion MX JDBC Connections.
In ASP.NET, I kept seeing this message in my logs: [DBNETLIB][ConnectionOpen (Connect()).]SQL Server does not exist or access denied. In ColdFusion, MSSQL datasources with correct connection information fail to verify.
I was pretty sure that all of my connection information was correct. My MSSQL Server was up and running, and I was logged into it using Enterprise Manager and Query Analyzer with the exact same information which were failing in .NET and ColdFusion.
I spent quite a bit of time messing around with a bunch of different settings in the SQL server and other places, but didn’t get anywhere. Out of desperation I did what I should have done first and Googled the error message. As a result I stumbled across this page. Apparently a lot of people have had this same problem for a variety of reasons.
I found the answer to the problem in the third to last comment on that page. Apparently, if you have an out of date version of the file DBNETLIB.dll Server 2003 and XP Service Pack 2 disables TCP/IP access to MS SQL Server. This is a defense against the Slammer worm.
To confirm this was the problem, I attempted to telnet to port 1433 on my localhost and could not. At this point, I was pretty sure I’d found the problem.
The solution to the problem was to go to this page on Microsoft.com and download the SQL Critical Update (SQLCritUpdPkg_ENU.exe). This update appears to deliver the needed DLL and, as a nice side effect, it patches you against the SQL Slammer worm.
After installing the patch I did a quick telnet to port 1433 and was able to connect. I then tried to use my ASP.NET app and, lo and behold, it worked just find. I also confirmed that JDBC connections to MSSQL from ColdFusion were now working and validating and I no longer had to use the (ugly) work around of ODBC.