locked
error: 40 with sql server 2000 RRS feed

  • Question

  • Hi

    I am getting this really annoying error that I cant resolve.

    I have created a website that accesses a SQL SERVER 2000 database and it works perfectly on my home machine. The error has occurred when I have transferred it to my hosts server.

    This is the 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)

     

    This is my connection string:

    <add key="ConnectionString" value="Provider=sqloledb;Data Source=hostsserver****,1433;Initial

    Catalog=db******;User Id=dbo*******;Password=********; "/>

     

    It says I am trying to connect to a SQL SERVER 2000 database as this is what I devloped the site on so I don not know why it thinks I am trying to connect to SQL SERVER 2005.

    Can anyone help?

    Thursday, June 8, 2006 8:24 AM

Answers

  • On you server machine, Start->All Programs->Microsoft SQL Server -->SQL Server Server Utility. Add TCP to your enabled protocols and restart sql server.
    Friday, June 9, 2006 12:44 AM

All replies

  • Moving to the Data Access forum.
    Thursday, June 8, 2006 3:49 PM
  • Is this constant or intermittent error?

    1) Make sure no typo on the data source (server name)
    2) Hostsserver,1433, implys it will use TCP, so make sure TCP is enabled on the sql server. Keep in mind firewall can block the traffic, so put 1433 into exception.

    Did you install SQL server 2005 and/or SNAC on your client machine? Client stack does not know whether the target sql server is 2000 or 2005. 2005 is always reported, You can ignore it.

    Thanks.

    Thursday, June 8, 2006 5:07 PM
  • Hi
    Thanks for replying.

    I have double checked the datasource and that seems right.

    How can I check if the host server is TCP enabled?

    I have never installed/used 2005 so dont know why.

    any help would be really appreciated.

    Thursday, June 8, 2006 5:47 PM
  • On you server machine, Start->All Programs->Microsoft SQL Server -->SQL Server Server Utility. Add TCP to your enabled protocols and restart sql server.
    Friday, June 9, 2006 12:44 AM