Solved

Opening a Connection to SQL Server via a VPN Connection

Posted on 2015-01-01
4
154 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 82

Accepted Solution

by:
Dave Baldwin earned 167 total points
Comment Utility
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
Comment Utility
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 68

Assisted Solution

by:Qlemo
Qlemo earned 166 total points
Comment Utility
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)
Comment Utility
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Join & Write a Comment

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

772 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

15 Experts available now in Live!

Get 1:1 Help Now