Using Local SQL Server Express 2008 Server with Coldfusion

So I know there are a few articles out there on this subject but I seem to have to reinstall sql server on my laptops often and I always have to hunt down how to do it so I thought I would post a blog so it would be a bit more recent.

I won't go over installing SQL Server Express, it takes a while seems like a good 30 minutes. Anyways, once you install it you can connect to your local database by connecting to the server (depending on what you named your server) [PC_Name]\SQLEXPRESS and depending on if you are using windows authentication you would enter your user name and password.

Ok so once you've gotten that installed there are some more tricky stuff you need to do within SQL Server. First you will need to turn on TCP/IP which is located under Start > Microsoft SQL Server 2008 > Configuration Tools > SQL Server Configuration Manager. Once you open up the manager go under: SQL Server Network Configuration and click on Protocols for SQLExpress (I assume this the name of the server). By default TCP/IP is disabled. So enable it by right clicking and enabling it. You will be prompted to restart your server service but I would wait until finished to do so. Now double-click TCP/IP or right click and go to Properties. Go into the IP Addresses tab and for each IPs enter in under TCP Port 1433. This allows for Coldfusion to connect to your database. Now you can apply and restart your server service.

A tip if you skip that last step you will get this annoying error message and this is why I needed to post this:

Connection verification failed for data source: rvikander java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect The root cause was that: java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect

If anyone has any thoughts or questions I would love the comments. Otherwise I hope this helps someone.

TweetBacks
Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
John Ramon's Gravatar Could be a number of things, first thing to check is TCP/IP is not disabled, to check run netstat see if you find localhost 1433 or something like 192.168.1.1, 1433. Do 'telnet localhost 1433' see if it fails, if so TCP/IP is not open. Check Charlie's post on this he explains how to turn it on.
http://www.carehart.org/blog/client/index.cfm/2006...
# Posted By John Ramon | 8/12/10 1:31 AM
Adrian J. Moreno's Gravatar Just wanted to add a link to Steve Brownlee's article on using ColdFusion with SQL Server Express:

http://www.fusioncube.net/index.php/coldfusion-sql...

He also details how to create a SQL Server User for use with your CF data source.
# Posted By Adrian J. Moreno | 8/12/10 5:53 PM
Ryan Vikander's Gravatar You don't need at add a sql server user if you are using sql server 2008. Just use windows authentication and it works fine.
# Posted By Ryan Vikander | 8/13/10 8:32 AM
Deepak kumar padhy's Gravatar Thanks a lot for ur post .
i had suffered a lot because of this problem but finally solved only due to ur post.

so keep posting .well done
# Posted By Deepak kumar padhy | 9/28/12 11:44 PM
Glenn Peterson's Gravatar This is the second time I've needed these instructions! Thanks for taking the time to document this process.
# Posted By Glenn Peterson | 9/26/13 6:47 PM
Sharath's Gravatar Keep posting in coldfusion. It really helps.
# Posted By Sharath | 3/1/14 5:14 AM
BlogCFC was created by Raymond Camden. This blog is running version 5.9.6.004. Contact Blog Owner