- Error: Failed to retrieve data from the database.
- Error when refreshing a report based on Excel in Crystal Reports.
- Able to refresh reports based on other MS Excel spreadsheet in Crystal Reports.
- When refreshing a report based on a specific MS Excel spreadsheet, using an OLEDB connection in Crystal Reports, it fails with the error:
"Failed to retrieve data from the database."
"Failed to retrieve data from the database.
Details: ADO error code 0x80040e10
Source: Microsoft Excel data engine
Description: No value given for one or more required parameters."
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
Reproducing the Issue
- In Crystal Reports, create a new report.
- In the Database Expert, under "Create New Connection", double click on "OLE DB (ADO)"
- In OLE DB (ADO), select the Provider:"Microsoft Office Access Database Engine OLE DB Provider"
- In the Connection Information screen, select the MS Excel spreadsheet.
- For the option: Office Database Type, select: "Excel"
- Add at least one database field on the report.
- When refreshing the report, it fails with the error.
The OLEDB Provider fails to retrieve data because the column headers of the MS Excel spreadsheet, contain leading spaces.
- Remove the leading spaces for each column header in the MS Excel spreadsheet.
- In MS Excel, open the spreadsheet.
- Remove any leading spaces from each column header. ( First row, for each column )
- Save the MS Excel spreadsheet.
CR, OLEDB , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem