Solved

Opening a Connection to SQL Server via a VPN Connection

Posted on 2015-01-01
4
160 Views
Last Modified: 2015-01-07
I'm trying to open a connection to a SQL Server instance via a VPN connection. The connection string I have is not working:

Provider=SQLNCLI11;Data Source=MySQLServer;Initial Catalog=MyDatabase;User Id=MyUSerID;Password=MyPassword;

I get this error:

Named Pipes Provider: Could not open a connection to SQL Server [53].

I also tried this connection string:

Provider=SQLNCLI11;Data Source=MySQLServer;Initial Catalog=MyDatabase;Integrated Security=SSPI

With what I think are my Windows credentials added to the list of security logins in SQL Server. To create the login, I used the VPN login credentials. I can't figure out how to add my workstation's Windows credentials - the workstation being the workstation on which I am running the VPN client.

What am I missing?

Kevin
0
Comment
Question by:zorvek (Kevin Jones)
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 167 total points
ID: 40527223
MySQLServer is Not MSSQL.  Two completely different products.

Windows credentials only work if the SQL Server is on the same machine or you are on Active Directory where the remote SQL Server can verify them.  Otherwise, you need to enable Remote connections on the SQL server and use SQL Authentication, username and password.

You can find connection strings for different situations here: http://www.connectionstrings.com/sql-server/
0
 
LVL 10

Assisted Solution

by:HuaMinChen
HuaMinChen earned 167 total points
ID: 40527262
Please ensure your connection string is something like
	<connectionStrings>
		<add name="conn2" connectionString="Data Source=192.?.?.?\your_db_instance;Initial Catalog=your_db_schema;Integrated Security=False;User ID=your_db_login;Password=??????" providerName="System.Data.SqlClient"/>
	</connectionStrings>

Open in new window


within Web.config/app.config file in your project, to ensure the project will work fine with the database.
0
 
LVL 69

Assisted Solution

by:Qlemo
Qlemo earned 166 total points
ID: 40527325
Named Pipes can get very problematic, in particular with non-domain clients. Make sure TCP/IP is enabled on MSSQL server and client. Disable Named Pipes on the client.
In regard of the authentication: You'll have to use explicit authentication, providing username and password, if not I the same domain.
0
 
LVL 81

Author Comment

by:zorvek (Kevin Jones)
ID: 40535936
This has turned out to be a network security issue so I'll close this question without identifying any specific response as a solution.

Kevin
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

685 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