SQL Server Express and Remote Access
August 7, 2007 · 17 Comments
What a pain in the ass this has been! I've never dealt with Microsoft SQL Server before but now that Vista runs acceptably on VMware Fusion, I figured that it would be a good opportunity to install SQL Server Express as a test database. The download / install process was not bad but of course the default is that remote access is not allowed.
After much Googling and much messing around, I finally got everything working but I feel inclined to comment on some of the web pages out there that provide instructions on how to do this...
The correct, detailed instructions were on Microsoft's Support Site
but that was not the first result in Google by a long way. All of the top results seemed to have missing or incorrect steps.
A couple focused on opening up port 1433 in Windows Firewall. The correct approach is to add sqlservr.exe and sqlbrowser.exe to the Exceptions pane.
At least one page focused on enabling access for a specific IP Address (and the instructions surrounding that were very complex!).
The key - from Microsoft's own support page - is to use the SQL Server Surface Area Configuration tool which makes life much, much simpler (although certainly not intuitive).
If I'd found that page first, I would not have wasted a couple of hours messing with a variety of control panels and utilities. I so wanted to just open up a text file in an editor and fix things - this is exactly why I find Windows so frustrating and like Unix (and Mac OS X) so much better!
At the end of the day, however, I have a data source in ColdFusion 8 on Mac OS X which hits SQL Server on VMware! Yay!
Tags: coldfusion · microsoft

17 responses so far ↓
1 Peter Tilbrook // Aug 8, 2007 at 12:38 AM
2 Peter Tilbrook // Aug 8, 2007 at 1:46 AM
Sigh!
At least when everything works it is stable and reliable. Just like ColdFusion 8 has been so far.
3 Sammy Larbi // Aug 8, 2007 at 2:58 AM
I've not had any trouble with it (but I haven't tried to do what you're doing). Good you posted a link though - I'm bookmarking just in case (and maybe your link will help push that page to the top of the results).
4 Matt Osbun // Aug 8, 2007 at 5:14 AM
The biggest source of help that I found was Charlie Arehart's blog. He's got a great article on solving issues connecting to SQLServer with ColdFusion.
http://carehart.org/blog/client/index.cfm/2006/7/8/sql2k5_Error_establishing_socket
5 charlie arehart // Aug 8, 2007 at 5:51 AM
http://carehart.org/blog/client/index.cfm/2006/7/8/sql2k5_Error_establishing_socket
Is that something you didn't have to do? I also explain there my own long strange trip to find that answer, so I feel your pain.
6 Jeremy French // Aug 8, 2007 at 6:11 AM
7 Brian Kotek // Aug 8, 2007 at 6:12 AM
8 Ken Dunnington // Aug 8, 2007 at 6:49 AM
To bring it back on topic :) I find SQL Server (or at least Enterprise Manager) to be very unwieldy and unfriendly. And configuring SQL Server over MySQL? No thanks. OS X on the desktop and Ubuntu on the server makes for a happy programmer!
9 todd sharp // Aug 8, 2007 at 9:05 AM
@Ken - IIS7 _is_ easier IMO. I'm in the younger, give me a GUI crowd. I like icons and UI - not XML/text config files. Again - just a matter of likes/dislikes if you ask me...
10 Sean Corfield // Aug 8, 2007 at 10:36 AM
@Sammy, I'll be honest, I posted the link partly as a reminder for myself in case of future issues :)
@Matt, the firewall issue alone wasted thirty minutes. However, CF8 can connect on port 1433 (but opening ports 1433 and 1434 - for the SQL Server Browser - was not enough, I had to add the executables to the firewall exceptions list).
@Charlie, I didn't have a problem from localhost but to enable remote access I did need to enable TCP/IP (and Microsoft recommended also enabling Named Pipes). Glad to know other people found it less than straightforward - makes me feel better :)
@Jeremy, I'm building out Vista on VMware as a full-blown dev environment. I'm in the process of trying to get BlueDragon.NET running (another blog entry will cover that). My views on Microsoft are well-known but I'm not interested in an O/S flamewar - I share my frustrations with OS X too (there's just a lot fewer of them :)
@Brian, SQL Server 2005 (non-Express) has most of this enabled by default, according to the pages I've been reading about the Express version. As for MySQL, well, my first attempts at setting that up remotely went much more smoothly than setting up SQL Server Express - and involved much less configuration work (essentially one SQL statement is all that is required to enable a remote user in MySQL - how much easier could it be?).
@Ken, I was pleased to see an XML configuration file for IIS7 (a huge step forward) but frustrated that I couldn't edit it directly. Having to open Notepad with Run As Administrator and then Open File... and navigate back to the config is a pain - why could I not simply Edit As Administrator? And why isn't there a GUI tool to fix / validate the config file?
Overall I ended up spending hours using Google to find solutions to problems that shouldn't even have existed in the first place. Most of this is about usability which has always been my big complaint with Microsoft technology. If you're used to it, you don't notice how unfriendly it is.
11 Shaji // Aug 8, 2007 at 7:10 PM
12 John Ramon // Aug 8, 2007 at 8:16 PM
Turns out when I installed and set it up I found a website (i'll have to find it again and post about it) but it showed how to find the port SQL Express was using. My setup is using port 50255, not even close to the default port. Other then that it was a easy setup across the board.
13 Jonathan // Sep 24, 2007 at 10:24 AM
1)open SQL Server Configuration Manager
2)under "SQL Server 2005 Network Configuration" in the left pane is "protocols for SQLExpress" (also in left pane). Click on it.
3)right-click on TCP/IP in the right pane and click properties.
4) Scroll down to see the IPALL TCP Dynamic port
THAT is the port you must enter in for Coldfusion to connect properly (it is different on every install of SQL Server Express by default - just one more *push* from Grampa MS to BUY it.)
14 Sean Corfield // Sep 24, 2007 at 11:31 AM
15 Guy // Feb 12, 2008 at 7:23 PM
16 Sean Corfield // Feb 12, 2008 at 8:02 PM
17 george // Sep 19, 2008 at 6:42 PM
i went through the same posts and even the microsoft help page didn't work for me. possibly because i am running sql server 2005 enterprise on my vmware fusion machine.
anyway long story short i logged in to the server locally and ran this command in a query:
Use master
Go
Xp_readerrorlog
then in the results it said it was listing on port 1138!!
i even checked the client settings and it swore it was listing on 1433!
anyway finally i too am up and running.
Leave a Comment