Symptom
- Error: 'Data Object cannot be opened/accessed.
- Unable to create, or refresh a report based on a specific Stored Procedure.
- When attempting to create a report based on a MS SQL Server Stored Procedure in Crystal Reports, it fails with the error:
'Data Object cannot be opened/accessed'
Environment
- SAP Crystal Reports 2013
- SAP Crystal Reports 2016
- SAP Crystal Reports 2020
Reproducing the Issue
- In MS SQL Server, create a Stored Procddure.
- In Microsoft ODBC Data Source Administrator, create an ODBC DSN to MS SQL Server.
- In Crystal Reports, create a new report based on an ODBC connection to the MS SQL Server Stored Procedure.
It fails with the error: 'Data Object cannot be opened/accessed.'
Cause
- The Stored Procedure contained a condition which does not always return the same data structure, and it is required to always return the same data structure to be able to connect to a Stored Procedure in Crystal Reports.
- For the list of Stored Procedures requirements to be able to connect to a Stored Procedure in Crystal Reports, see the SAP Knowledge Base Article:
1892878 - Stored Procedure requirements for creating reports in Crystal Reports
Resolution
- Modify the MS SQL Server Stored Procedure, to always return the same data structure, regardless of the condition(s) set in the Stored Procedure.
Keywords
CR, SP, StoredProc , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem
Product
SAP Crystal Reports 2013 ; SAP Crystal Reports 2016 ; SAP Crystal Reports 2020