Help : "error: 40 - Could not open a connection to SQL Server"

I'm using VS2005 and SQL2000. I created a database name "myDatabase" in SQL Server 2000 and built a website that
connet to this database. When I'm running this website in VS2005 IDE (press F5 or Ctrl-F5), everything is OK. I publiced
this site. When I connect to database on my computer, everything is OK also, but when I connect to database on another
computer, an error occurred like this :

"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) (Microsoft SQL Server, Error: 2)"

Now, I don't know how to fix it. Pls help me as soon as possible.
Regards.

[860 byte] By [undead142] at [2007-12-26]
# 1
Hi - I am having the exact same problem.

Thomas

ThomasKoch at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 2

Me too,

After switching from Enterprise Manager to Management Studio I can no longer connect to remote databases (version 2000):

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) (.Net SqlClient Data Provider)

Update: Using MS Access 2000 I can still connect, by creating an "Access Database Project". Not really good enough, though.

Agalab at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 3
Same problem here... I'm not sure what I changed, but I can't access my database anymore.
ReiMiyasaka at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 4
Same sort of problem here.

Installed VB.net 2003 alongside VB6 and now my vb6 programs cannot connect to remote servers. I use MSDE on my own computer with enterprise manager for access to the main server and my own computer and nor can enterprise manager connect anymore to remote servers.

The only thing that has changed on my computer is the installation of VB.net 2003.

Doc_BrownAKANeil at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 5
Have some simular issues here too, totally random though.
FredrikMelin at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 6
Same problem here.
I'm using VB.net 2005 Express and Mysql Server Express.
I'm connecting (for now) to a sql server on my same local machine as my vb.net.
Anyone figure it out yet?
Havan at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 7
I ended up reinstalling SQL Server and Visual Studio. Reinstalling SQL Server didn't help; reinstalling Visual Studio and SQL Server did. I don't know why.
ReiMiyasaka at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 8
Ok. Try this. Get the visual Basic 6 Runtime Files from Microsoft of wherever they reside.
(I had a copy on my computer from a previous problem)

Install them as normal, 2 min job, then try your connections again to remote servers.

I did this and suddenly I was able to connect to remote servers again.

vbrun60sp3 size 0.98mb is the file I used.

It is available still if you put the file name in microsoft and search.

WHAT I DONT KNOW IS IF I AM DOING ANY OTHER DAMAGE BY INSTALLING IT!

I AM NEW TO VB.NET AND DONT KNOW ENOUGH TO TELL IF I HAVE BROKEN SOMETHING ELSE BY INSTALLING IT.

Thanks.

Doc_BrownAKANeil at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 9
Hi Havan,

I'm having exactly the same

problem. Please let me know if you know how to fix the connection

problem with VB2005 and SQL Express. Thanks in advanced.

DC

DC1 at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 10

Same problem / error

Laptop at work no problem connecting to remote sql server

Same laptop at home could not connect to server

ISP is blocking port 1433 to prevent sql worms

Talked to ISP and they unblocked 1433,

Be persistent with them!

Use netstat -an to view open connections

TCP IP:random port IP:1433 results

before unblocking

TCP ?.?.?.?:1184 ?.?.?.?:1433 SYN_SENT

After unblocking

TCP ?.?.?.?:1184 ?.?.?.?:1433 ESTABLISHED

wabroussard at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 11
Hello,

I was having this same problem.. I was trying to connect Visual Web Developer 2005 to the SQL Server Express 2005.

My problem was:
I was connecting to <machine name> as my server... after changing it to <machine name>\SQLExpress it started working fine. Hopefully this helps.

anx

anxvariety at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 12

The above solution worked for me as well but my problem was that I was connecting to SQL 2000 where SQL 2005 was also installed.

The connection worked until I moved from app home to work locally on my XP System. Our server only has SQL 2000 but my local machine has 2005 and 2000 running.

I suspect that there are more variations to this problem.

Pete

www.sensibleprogamming.com

West Coast of America

PeteBennett at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 13

I have the same problem, but this didn't help for me.

Can someone pleace give me an example how the connectionstring would look like, when connection to an shared sql server on another server.

brajoh at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...
# 14
This worked perfectly! I was dreading having to do something like a re-install.
Los76 at 2007-9-4 > top of Msdn Tech,.NET Development,.NET Framework Data Access and Storage...

.NET Development

Site Classified