Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2000 error

Status
Not open for further replies.

putrtek

Programmer
May 18, 2003
49
US
I am conntecting via a ASP.NET 2.0 web application to a SQL Server 2000 server. When I try to execute the page from my web server I get the following error.

Code:
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 am able to successfully connect to the SQL server from the web server with OSQL using the same credentials I'm using in my app. So I know is not a network issue.

Does anybody have any ideas on how I can get around this error?

-MARK-

Mark Buckley
 
Does the server have net2.0 installed?

-SQLBill

Posting advice: FAQ481-4875
 
Typically this will be caused by SQL either not being started, not being setup for remote connections or a firewall between the machines stopping the connection, or an invalid server and/or instance name in the connection string.

As SQL 2000 is setup by default to listen for remote connections it's probably the firewall or a typo.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
I'm 100% certain it's not firewall. I'm on a corporate network. They dont block web traffic internally. Regular ASP pages work fine, it the ASPX pages I'm having a problem with.

I dont think it's a typo... I've looked at my conection string a least 50 times... everything is spelled right. I can cannot to the same SQL server with OSQL and the same credentials I use in my connection string, so I dont think it's a typo.

Any other possibilities?

Mark Buckley
 
make sure your connection string is correct for .NET. there are differences from classic asp.
connectstrings



[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
Also, just because the web server has 2.0 installed doesn't mean your application is using 2.0. You need to make sure in IIS manager under the ASP.NET tab that 2.0 is selected and not previous versions.

In saying that are you sure that ASP.NET is registered/installed on the server as well? You need to run the aspnet_regiis.exe after downloading and installing 2.0 for each version of the framework. It will be inthe winnt/windows\microsoft.net\framework\v2.... folder

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
onpnt,

I have two SQL servers. I can connect and run ASP.NET 2.0 files from this web server to SQL server 2 just fine. When trying to connect from this web server to SQL server 1 is when I get the error I list above... so my logical mind would tell me the problem is not on the web server, but on SQL server 1. Does that make sense? I just cant figure out what the problem is with sql server 1.

Mark Buckley
 
got it. are named pipes - TCP/IP enabled on the sql server

I'm running out of ideas. Hopefully the more experienced members will have more insight

[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
Yes, Both Named Pipes and TCP/IP are enabled on the SQL server. Using a suggestion I found on another forum I even created an Alias for both using the server name. I'm running out of ideas also... Thanks for your assistance so far.

Mark Buckley
 
I hate to say it (again sense mrdenny stated it) but I would go back to investigating the network or server (OS) level settings. 9 times out of 10 when a connection problem is there and SQL Server is set to as such remote connections should be allowed without complications the fault is either OS level or the network configuration.



[sub]____________ signature below ______________
The worst mistake you'll ever make is to do something simply the way you know how while ignoring the way it should be done[/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top