Wednesday, March 21, 2012

problems connecting to remote SQL Server 2005

I'm using Visual Studio 2005 Pro and am attempting to connect to a remote SQL Server 2005. I have the server name, SQL login credentials, and database name. However, when I try connecting I get this error:

"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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

I know that remote access is enabled because I received the connection instructions directly from the database administrator. I've tried turning off my firewall. I've tried connecting with Data source: Microsoft SQL Server using both Data providers: ".NET Framework Data Provider for SQL Server" and ".NET Framework Data Provider for OLE DB". Nothing seems to work.

Any suggestions for what I may be doing wrong? Do I have to have certain software installed on my computer to make this work (other that VS2005)?

-Mathminded

You have to configure SQL Server for remote connection and it is covered in the thread below, post again if you still need help. Hope this helps.

http://forums.asp.net/thread/1379211.aspx

|||

Thanks, Caddre. Just to clarify, I am trying to connect to a remote SQL Server 2005 that is maintained by someone else. They already have remote access enabled, but I haven't been able to connect to it. They have hundreds of users and the rest of them are connecting fine. Do I also have to enable remote access on my local SQL Express installation in order to connect to their server? It seems counterintuitive to me so I want to double-check before I spend several MORE hours trying to get this to work.

Thanks!

|||

I see your point but there are many reason for such problem so it takes time, I have found two troubleshooting links provided by Microsoft and another provided by another developer, run through the check list and post again if none works. Hope this helps.

http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx

http://blogs.msdn.com/sql_protocols/archive/2006/04/21/581035.aspx

http://geekswithblogs.net/timh/archive/2006/01/30/67586.aspx

|||

Thanks again, Caddre. I really appreciate your help. I've checked out all that information but it hasn't led me to a solution. I hate to give up an entire night of work, but I'm going to have to give up on this for now and try again tomorrow. If I come up with anything, I'll post it.

Thanks! :-)

|||If those did not work then it is either connection string or permissions you need to check back with them I hope you are not having this problem with Godaddy because users always run into problem with them. Hope this helps.|||

Problem solved! :-) It turns out they had never had a remote user have to access the SQL server from outside the company, so it was a firewall issue. They added my IP as an exception and it worked flawlessly. Thanks again, Caddre, for your willingness to help. I really appreciate it.

-Mathminded

|||

Problem solved! :-) It turns out they had never had a remote user have to access the SQL server from outside the company, so it was a firewall issue. They added my IP as an exception and it worked flawlessly. Thanks again, Caddre, for your willingness to help. I really appreciate it.

-Mathminded

|||

I am glad to see your problem was resolved but fire wall addressed in the protocol troubleshooting link I gave you.

http://blogs.msdn.com/sql_protocols/archive/2005/12/22/506607.aspx

|||

You're right, it was in those lists. That was one of the things I tried checking last night and one of the reasons I decided to give up. Unfortunately, there is no way (that I know of) to know with certainty that you are being blocked by a firewall. Last night I did try to ping and telnet to the server (two things from the links you provided) but when that didn't work it either meant they had disabled those functions OR I was being blocked by a firewall.

I'm glad you replied. I had marked the thread as resolved but hadn't remembered to mark your post as the answer. I don't know how the whole points thing works on this site, but if that's how people get points I wanted to make sure you got them.

Thanks again for all your help.

-Mathminded

|||Fire wall always block database and web server, it is the second thing to check after the configuration of the server and the points are not important to me anymore I have moved on from that subject, I always post again as needed so it will help future users with same problem.sql

No comments:

Post a Comment