Results 1 to 3 of 3

Thread: No connection to SQL Database - VB.net + VPN

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2011
    Posts
    7

    Question No connection to SQL Database - VB.net + VPN

    Hi all,

    I have problem with my sql connection, or sql port. I would like to connect with my VB.net application to sql database placed on my server (external machine). Normally, when I'm connected to normal net - everything works great. But when I'm trying to connect with the application to SQL database while I'm on Dual VPN net - ther's no connection.

    Error appear:
    System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

    and my connection string is like:

    Code:
      Sub Connection()
            cnn.ConnectionString = "Data Source=SZYS2\MORSERVER;Initial Catalog=TimerTool;Integrated Security=True"
            'cn.ConnectionString = "Provider=" & provider & "; Data source=" & strDatabase
            cnn.Open()
    ...
    ...
    I was trying to check the ping with telnet - no connection. The thing is, that to the shared folder on the server, where SQL is, I have access even when connected to Dual VPN...

    I was thinking about - to put direct path to the database, but it's not working as well...

    Any suggestions guys?

    Thanks in advance!

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: No connection to SQL Database - VB.net + VPN

    Isn't the whole point of a VPN to prevent direct connections to your computer?
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

  3. #3
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: No connection to SQL Database - VB.net + VPN

    You are not connecting to a folder with MS SQL server.

    You are talking with a service running on a machine - in this case a remote machine.

    The VPN should allow you to access the physical box. What is the IP address of that box?

    Can you ping it?

    That is the first line of attack at finding out why MS SQL won't talk to you.

    Keep in mind that MS SQL Server Express is setup to deny remote connection by default - that can be changed. How it works and how it is changed is based on the version of MS SQL you have.

    What version of MS SQL do you have? Is it express?

    This thread belongs in the DB section of this forum - you should PM a mod to move it.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width