Problem connecting to database

Nov 3, 2009 at 1:14 AM

I downloaded the project wsp file and deployed it using stsadmn.  I can see the web part and can select it but I am having problem with the database connection setting.  I am unable to connect to the database and get the following error message.  pelase help.

A problem occurred while trying to load the most frequently used pages. A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)

I realy need this web part.  any help is appreciated

Nov 3, 2009 at 12:22 PM

I notice it's talking about the named pipes provider. We use TCP/IP where I work (and where I developed this). Can you post screenshots of the Web part configuration entries you've made for the SQL Server connection? Feel free to blur out the server name if that's too sensitive of information for the internet.

Nov 4, 2009 at 2:04 AM

Thank you for looking at this.  I took your connection string server=myserver;initial catalog=iislogs;integrated security=sspi and replaced the server name with my server name.  I used the GetTopHits for stored procedure option.  The database on my server was configured by WSS 3.0 install, I have not changed anything.  Also the IIS 6.0 is the way it was I have not changed anything there either.


Nov 4, 2009 at 2:11 PM

I am still intrigued by the mention of a named pipes provider. Googling on the error message gets lots of hits that indicate connectivity (or firewall) issues between the SharePoint server and the database server. One Google hit suggests trying to troubleshoot connectivity issues with basic tools such as osql, but you may not have the SQL Server Native Client tools installed on the SharePoint server. If you do or can get them installed, you could try the following at a command prompt:

osql -E -Stcp:<your-db-server-name-here>

If it can get to the SQL Server the results of the command will be an osql command prompt that looks like this:


(You can type "exit" to get out of osql.)

If there are connectivity issues you will get an osql error message instead. Another thing you could try would be to set up an ODBC data source on the SharePoint server to the IIS logs database on the SQL Server and use the Test Connection button to see if it can get there. Also, since it mentions that it could be either a network or an instance error, if the IIS logs database is not on the default instance you will have to change the connection string to include the instance name.

Apr 20, 2010 at 9:34 AM



I got the same error and fixed it by providing the servername and the DB instance e.g Server =servername\databasename.


now I am getting a different error "A problem occurred while trying to load the most frequently used pages. Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'."


any idea how to get around this error.

Apr 20, 2010 at 12:35 PM

In the connect string, are you giving a user name and password? If not, do you have "trusted connection=sspi" or "trusted connection=true"? You may have to enable the machine account (for machine name foo on domain bar, it would be bar\foo$) as a login on the SQL Server instance and as having appropriate access permissions on the database you're storing the log files in.

Jun 10, 2010 at 4:55 PM

I tried doing the same, I have added uid=username; pwd=password attributes to the connection string but it again throw the NT AUTHORITY\ANONYMOUS LOGON  login failed error. Could you please help?

Jun 10, 2010 at 7:24 PM

Have you tried setting the machine account as a valid login on the target SQL server and giving it SELECT access to the database? For machine name foo on domain bar, the SQL login name would be bar\foo$.