Results 1 to 4 of 4

Thread: Error 40-Could not open a connection

  1. #1
    Join Date
    Jan 2009
    Posts
    81

    Error 40-Could not open a connection

    Hi friends,

    I am facing an issue while Connection to Sql server whenever i am trying ia m trying to make connection i am getting the following error message

    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.
    error: 40 - Could not open a connection to SQL Server.


    I don't know whats wrong with this can any one provide me solution for it.

  2. #2
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Error 40-Could not open a connection

    Sure i will help you out with this try to follow the below steps.

    Click on Start goto Programs, then Microsoft SQL Server 2005 - - >Configuration Tools- - > SQL Server 2005 Surface Area Configuration - >Surface Area Configuration for Services and connections.

    Over here do check whether "Local and remote connections" is chosen or not if not then try to follow the below steps:-

    • First open SQL Server Configuration Manager
    • Now Expand SQL Server 2005 Network Configuration under Configuration Tool.
    • Now select Protocols for and set the Named Pipes To Enabled.

  3. #3
    Join Date
    Jan 2009
    Posts
    81

    Re: Error 40-Could not open a connection

    I try to do the above things but still getting Error 40-Could not open a connection message.

  4. #4
    Join Date
    Dec 2008
    Posts
    128

    Re: Error 40-Could not open a connection

    I was also getting Error 40 message but i try to do the following things and it worked for me.

    Firstly you need to enable the TCP/IP protocol using the Surface Area Configuration Utility.Over here make sure the TCP/IP protocol is enabled in the SQL Server Configuration Utility and also make sure the SQL Server browser is started. Note that this step is optional. It is possible to set the SQL Server instance to use a fixed IP address.Make sure SQL Server and SQL Server Browser are exempted by the firewall on the server machine. This is done by putting sqlservr.exe and sqlbrowser.exe as an exception in the windows firewall.Finally restart your machine and try to connection it again now you won't get Error 40-Could not open a connection error message again.

Similar Threads

  1. Replies: 9
    Last Post: 14-05-2012, 06:05 PM
  2. Replies: 1
    Last Post: 27-02-2012, 05:53 PM
  3. HTC Hero shows Error 170 USB connection error
    By Pandeyji in forum Portable Devices
    Replies: 3
    Last Post: 23-04-2011, 04:35 PM
  4. ExecuteReader requires an open and available Connection.
    By AmolP in forum Software Development
    Replies: 1
    Last Post: 03-02-2009, 07:08 PM
  5. Replies: 2
    Last Post: 15-12-2006, 07:29 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,190,113.76005 seconds with 16 queries