none
Shared Memory Provider, error: 40 RRS feed

  • Question

  • Whenever I try to add an empty MS SQL 2005 database (this goes for the express version on my computer and remote version on the server) to the App_Data folder in my DotNetNuke source, I receive the following error:

    "An error has occured while establishing a connection to the server.  When connecting to the SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections (provider: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server)"

    Express is set up to receive sql calls, and I have the shared memory provider disabled - yet it still tries to use this.

    Monday, February 27, 2006 4:33 AM

All replies

  • Networking protocols are disabled by default in SQL Server Express. The error message you will get when trying to connect from SQL Native Client will look 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 default settings SQL server does not allow remote connection. ( provider: Named Pipes Provider, error: 40 - could not open a connection to SQL server. )”

     

    The solution to this is to enable remove connectivity on SQL Express; it sounds as though you've done this.  Since SQL is a named instance you will have to enable SQLBrowser so it can resolve the correct port to connect to.  This you can open the services controll manager and enable the SQLBrowser service to start. (or issue 'net start sqlbrowser'; though it won't start the next time the box is rebooted because the service is set to manual start.

     

    For more information see step #2 below.

    http://blogs.msdn.com/sqlexpress/archive/2005/05/05/415084.aspx

     

    Monday, February 27, 2006 6:20 PM
  • My SQLBrowser is on, and the only protocol that I have enabled is TCP/IP.
    Monday, February 27, 2006 10:06 PM
  • Is there any possibility that there is an alias defined for the server you specify in the connection string? 

    As Brad mentions the typical error message one gets says "Named Pipes Provider" but you get error saying "Shared Memory Provider".  One cause for this is when SQL Browser does not return information about the TCP protocols. 

    Did you restart SQL Server after enabling TCP?  To troubleshoot, you can prefix the server name with "tcp:", e.g. "tcp:.\SQLEXPRESS". 

    One work-around that would probably make your connection work would be to enable Shared Memory on the server but I assume you want to keep it disabled. 

     

    Tuesday, February 28, 2006 2:37 AM
    Moderator