Friday, January 22, 2010

Non-Specific Data Source Error in Sharepoint Data View Web Part

Friday, January 22, 2010
I ran into another annoyingly generic M$ error today when trying to configure the data source for a Data View web part (DVWP) in Sharepoint Designer.  I had created a SQL view which referenced some Sharepoint list data, did some calculations in SQL, and I wanted to show the results back in Sharepoint.

I was able to successfully show the list of SQL tables / views in the data source manager, but as soon as I selected my SQL view and clicked Next, I saw:
"Server Error: An error occurred while retrieving the list of Databases from : The server for the data source returned a non-specific error when trying to execute your query. Check the format and content of your query and try again. If the problem persists, contact the server administrator."
I found a forum where a user suggested that the issue was  Sharepoint Designer failing to properly handle SQL queries that were missing fully qualified table references.  I played around with that idea and determined through testing that it wasn't the source of my problem.

But, it did cause me to remember that the SQL database in which I'd created my view was not the Sharepoint Content database, and I had referenced Sharepoint data.  The view ran fine in SQL.  But I wasn't configuring the Data View web part with *my* credentials.

Aha!
Problem resolved:  in SQL, add a User Mapping to the Sharepoint Content database in the properties of the login I was using in my Data View

0 comments:

Post a Comment