Over the last few months, we have seen a few more instances of people using data sources that require a DSN connection to retrieve data for PowerPivot and Excel workbooks. Normally, if you are just using these data connections inside the client, you just refer to the DSN as a data source and all is well. This changes while attempting to utilize this data source from within SharePoint as Excel Services and PowerPivot do not understand DSNs and fail to connect.
To this end, this blog will cover a basic scenario where a DSN is required to connect to a data source. This may not cover EVERY scenario because every data source is different, but it should be a solid guide on how to get started. For my example I will use Amazon RedShift as I recently worked a case with this data source.
With my Data Source and sample data created and configured, I begin by installing the appropriate x64 drivers on my servers. In some cases, you may have a 32-bit client. This is fine, but note that Excel Services and PowerPivot will only use x64 drivers to connect. You will need to contact your data source vendor to obtain the appropriate drivers to install. This is not something we can generally provide as we would be doing searches online just like you.
I am doing this example in SharePoint 2013, but this process will hold true for SharePoint 2010 as well. Also, the workbook I create will be within the scope of Excel rather than PowerPivot because PowerPivot does not support connections to RedShift. You will find that for the "Odd data source type" it will be trial an error whether or not your connections will work properly with PowerPivot. Some may work only in Excel, and some may work for both.
After the drivers are installed, I configure my DSNs. Here are a few things to remember:
– Even if you use the 32-bit driver on your client, you MUST use the 64-bit driver on the server.
– The DSN name MUST be the same on the server and the client. (regardless of the driver version)
– Use a System DSN and not a User DSN.
– Create the DSN on ALL servers hosting Excel Services and PowerPivot Analysis Services. (In SharePoint 2010, these will be SharePoint servers, in SharePoint 2013, the PowerPivot Analysis Services servers may be outside of the farm).
When you finish entering the information for the DSN on the server, make sure you test the connection. If it is unable to connect with the DSN, Excel\PowerPivot will not be able to connect and you may get errors that don’t really mean anything in the logs:
Once the DSNs have been created and confirmed working, we can start configuring SharePoint.
Navigate to the following in Central Administration:
"Central Administration > Application Management > Manage Service Applications > Excel Services Application > Trusted Data Providers"
Add the MSDASQL.1 provider to this list (this is the provider we will use to connect to the DSN).
We then need to recycle Excel Services:
- Stop Excel Calculation Services on all servers in the farm.
- IIS reset those servers.
- Start Excel Calculation Services on those servers again.
You will also need to create a Secure Store ID containing the credentials you wish to connect to the data source with.
Lastly, we will create our workbook.
Click on "Data > From Other Sources > From Data Connection Wizard > Other/Advanced"
Choose "Microsoft OLE DB Provider for ODBC Drivers"
Enter the name of your DSN in the "Use data source name" field.
Test the connection to validate it is working, and then click "OK"
From here, build your workbook as you normally would.
Make sure to modify the data connection to use the "Secure Store" in Excel Services.
Navigate to "Data > Connections > Properties > Definition > Authentication Settings
Choose "Use a stored account" and enter the secure store ID you created for this data source.
Save the workbook and upload it to a SharePoint library.
Open the workbook in the browser and test the refresh.
For more blogs by our team and/or more troubleshooting help, check out the main blog!