SAP Knowledge Base Article - Public

3421439 - Error: "Failed to retrieve data from the database.... [ODBC Shadow driver]Socket closed." when refreshing reports connecting to DB2 in Crystal Reports

Symptom

  • Error: "Failed to retrieve data from the database..." when executing some reports.
  • When refreshing some reports connecting to DB2 via ODBC in Crystal Reports, it fails with the error:

    "Failed to retrieve data from the database.
     Details: 08S01:[DataDirect][ODBC Shadow driver]Socket closed."

Environment

  • SAP Crystal Reports 2020
  • IBM DB2 

Reproducing the Issue

  1. In Microsoft ODBC Data Source Administrator, create an ODBC DSN to IBM DB2 using the Shadow client ODBC driver.
  2. In Crystal Reports, create a new report connecting to DB2 via ODBC
  3. Add multiple Tables to the report, and link it.
  4. Add many Database Fields to the report.
  5. Refresh the report, and it fails with the error: 
     "Failed to retrieve data from the database…  [ODBC Shadow driver]Socket closed."

Cause

  • All reports that are failing have a large SQL Query, and uses the DataDirect Shadow Client ODBC driver to connect to IBM DB2.
  • Reports with large SQL Query fails because the DataDirect Shadow Client ODBC have a limited buffer size.
  • DataDirect Shadow Client ODBC is not a supported ODBC driver to connect to IBM DB2 from Crystal Reports.
  • For reference, see the supported platforms document for Crystal Reports: 2859510 

Resolution

  • Use a supported ODBC driver to connect to IBM DB2 from Crystal Reports, like the CR DB2 Wire Protocol ODBC Driver:
    1. In Microsoft Data Source Administrator, rename the current ODBC DSN the report uses to connect to IBM DB2:

      1. In MS Windows, in the search bar, type: ODBCAD

      2. In the list of application displayed, right click on: ODBC Data Sources (64bit), and select: "Run as Administrator"

      3. In "ODBC Data Source Administrator (64bit)", select the tab: "System DSN"

      4. In the System Data Sources list, select the ODBC DSN the report uses to connect, and click the button: "Configure..."

      5. In ODBC DSN, rename the Data Source Name, and add to the end of the DSN, something like: _OLD

      6. Click "OK" to accept the change.
                 

    2. Create a new ODBC DSN to IBM DB2 using a supported ODBC driver, like: CR DB2 Wire Protocol ODBC Driver, or the IBM ODBC driver:

      1. Still in the window "ODBC Data Source Administrator (64bit)", under the tab  "System DSN", click the button: "Add..."

      2. In the window: "Create New Data Source", select the ODBC Driver: "CR DB2 Wire Protocol ODBC Driver", or the IBM ODBC Driver, and click "Finish"   

        Notes: 
        The CR DB2 Wire Protocol ODBC Driver is installed by default with Crystal Reports, but if it is not installed, you can install it by modifying the installation of Crystal Reports, by going to the Add / Remove Programs in MS Windows. For more details, see the SAP Knowledge Base Article: 1218152  

      3. In the window "ODBC DB2 Wire Protocol Driver Setup", under the tab "General", enter the Data Source Name the report is using.   

      4. Then enter the information for your DB2 server and database.  ( This information can be obtained from your DB2 Database Administrator. )               

      5. At the bottom left corner of the window, click the button "Test Connect"

      6. Enter the database user name, and password to confirm it connects successfully to your IBM DB2 database.

      7. Once you confirm it is connecting to the IBM DB2 database successfully, click: "OK"
            

    3. In Crystal Reports, refresh the report based on IBM DB2

Keywords

CR, IBMDB2, ShadowODBC , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2016 ; SAP Crystal Reports 2020