Wrox Programmer Forums
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old December 6th, 2006, 02:58 AM
Authorized User
Join Date: Oct 2006
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error 40

I'm using VS2003 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 VS2003 IDE (press F5 or Ctrl-F5), everything is OK.
It was my localhost. Then I tried to install again on my server after installing .NET framework 2.0.But when my application
is trying to connect sql server, it is giving error 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)"

My connection string was: Server:XYZ;uid=sa;password=hello;Database=NewProje ct.

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

Old December 7th, 2006, 01:31 AM
Registered User
Join Date: Dec 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to ghemant

Ensure if Remote connection for Local and Remote Connection is allowed if not

Microsoft SQL Server 2005->Configuration Tools->SS2005 Surface Area configuration-> Surface Area configuration for Services and Connection->Remote Connection->Local And Remote Connection->Using Both TCP/IP and Namedpipes-> Apply


With Regards
Hemantgiri S. Goswami
"Humans don't have Caliber to PASS TIME , Time it self Pass or Fail Humans"  -Hemantgiri S. Goswami

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error 40. Do anyone known it? Please help! avgCS Classic ASP Basics 0 July 27th, 2007 06:53 AM
Error 40 prasanta2expert ASP.NET 1.x and 2.0 Application Design 1 December 6th, 2006 06:04 AM
Error 40 prasanta2expert ASP.NET 1.0 and 1.1 Basics 0 December 6th, 2006 02:58 AM
Named Pipes Provider, error: 40 ipaine SQL Server 2000 1 November 14th, 2006 03:36 AM
using &#40 instead of ( crmpicco HTML Code Clinic 5 April 10th, 2006 09:06 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.