Problem connecting from outside the lan

Posted on 2007-10-04
Last Modified: 2010-03-19
Hi all,

I have SQL Server 2005 Express running on a Server 2003 server.
I *think* that I have remote connections enabled correctly as i can connect to the db from any of the machines on the LAN via the server name or it's ip address.

i need to be able to connect to the db from outside the LAN - ie from home, or on the road, using my router's ip address.

i have opened a port in my routers firewall and forwarded that to the ip of the server.
The browser service is running, and remote connections are enabled via TCP/IP and NamedPipes

If I try using my program, which works if i use the internal 192.168.1.x address or the server name in the connection string, i get the following:

System.Data.SqlClient.SqlException: An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: TCP Provider, error: 0 - No connection could be made because the target machine actively refused it.)

i have tried using SQL Server Management Express also using

and i get the same error - but i can connect using the and server name.

what am i missing?


Question by:sgaggerj
    LVL 75

    Accepted Solution

    can you check whether SQL Browser is running as i mentioned here
    LVL 1

    Author Comment

    Yup - it's running.

    I figured out what was wrong.  Mostly my stupidity.

    1) I was trying to use Windows Authentication.  <- stupidity
    2) I didn't change the security of the server to allow Windows or SQL security

    Once i used the correct account and changed the security options, i can connect no problems now.

    i'll give someone the points if you can tell me how to go about locking the system down so that someone who knows my ip and port cant (easily) get in


    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
    So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now