SAP Knowledge Base Article - Public

2998352 - Error: 'Data Object cannot be opened/accessed.' when updating a connection to a SQL Server Stored Procedure in Crystal Reports

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

  1. In MS SQL Server, create a Stored Procddure.
  2. In Microsoft ODBC Data Source Administrator, create an ODBC DSN to MS SQL Server.
  3. 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