sql server 8.0 - need to access the database remotely using ip address

Posted on 2006-06-07
Last Modified: 2010-04-17
Hi Experts,
I am working with sql server database and visual basic 6 and need to access the database remotely in my visual basic 6 application. Could I set the database so that I can reference it remotely using IP.
I want to then be able to create an ODBC dsn pointing to the db using its IP address so I can use the dsn in my VB6 application to connect to the db. I have seen this working in another application but dont know how. Please help with details.
Question by:uzairp
    LVL 4

    Assisted Solution

    1. Make sure that remote PC has SQL Client Utility installed and TCP/IP Protocol is enabled. Go to Start, Programs, MS SQL Server, SQL Server Client Network utility and check.
    2. Go to the alias tab of SQL Server Client Network utility and add an alias for TCP/IP.
    3. Then create the ODBC connection for sql server, using IP Address as the SQL Server name

    I hope it will work.
    LVL 16

    Accepted Solution

    batchakamal is right about having to use the TCP/IP client connection.  Furthermore, you must ensure there are no firewalls that will block the SQL connection, including Windows Firewall included in XP SP2.  By default SQL Server listens on port 1433, but that can be configured.  The firewall protecting the server must allow incoming connections, see

    To configure Windows Firewall, see

    Author Comment

    I followed this procedure but I still cannot connect. Here is what I did;
    1. I have sbc dsl service in my office and have a 2-wire router that came with it. The sql server is loaded on the computer named 'Main' in the LAN and is configured with an ip address that starts with 192 (it is not configured with its own public ip)
    2. I enabled the TCP/IP and started the SQL Agent service on the Main and then went to the router to forward port 1433 to the Main.
    3. I went to and got the ip address.
    4. Then I used my laptop computer from another location to try to connect to the sql server on the Main computer in my office. I started SQL server agent in my laptop as well and then created an ODBC-system DSN using the ip address in step#3 . I entered the sql username/password.
    5. I got connect() error. I tried it several times using different sername/password including 'sa' but still could not connect.
    I am not an expert with network stuff but I had some help last time when using PC Anywhere remotely and this is the procedure I had followed as far as port forwarding on the router. Let me know if I am missing something or doing something incorrectly. I apologize for a delayed response.

    Author Comment

    Forgot to mention that I also turned off the windows firewall as well during my test.
    LVL 16

    Expert Comment

    does your router have a log?  See if the connection got blocked or fowarded.  Alternativly you could shutdown SQL and set IIS to use port 1433 instead of 80 to test if the connection is coming through (use http://ipAddress:1433). Is your DLS a business DSL intended to support servers?  Home DSL's often block many ports to prevent you from setting up a server.

    Author Comment

    I still got "rasserver - General network error. Connection read recv()

    On the server alias, I entered the following;
    server alias: rasserver
    server name:
    clicked 'Checked' for Dynamically determine port.
    Is this correct? Could you think of anything else I should check.

    I checked the log and this is the only entry I got for the date that I performed my test says "Issuing Periodic Heartbeat request" and "Periodic Heartbeat completed".
    I dont know where to go to find the option for http to use port 1433. How you tell me how, I can perform that test too?
    LVL 16

    Expert Comment

    >>I dont know where to go to find the option for http to use port 1433. How you tell me how, I can perform that test too?

    I would shut down SQL Server.
    create a simple test html file , perhaps named test.htm and containing only "<HTML><BODY>Hi there</BODY></HTML>"
    Place this file in C:\inetpub\wwwroot (assuming you have IIS installed in the default location)
      (test it on your machine by using http://localhost/test.htm)
    Go into "Internet Information Services", aka IIS Manager
    Find "Default Web Site", right click and choose properties.
    On the first tab ("Web Site") you will see "TCP Port", which is at 80.  Change it to 1433.  
      (test it on your machine using http://localhost:1433/test.htm)
    test it from outside using

    If you get the "Hi there" you are getting to your machine.

    Also see that article, I believe SQL 8.0 needs an additional port.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    lucky13 challenge 11 96
    bigHeights  challenge 13 43
    array220 challenge 8 29
    wordmultiple challenge 12 62
    Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
    Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 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

    11 Experts available now in Live!

    Get 1:1 Help Now