Failed to Retrieve Data Error

Failed to Retrieve Data Error

Failed to Retrieve Data Error

This knowledge base article will assist you with how to retrieve data from the database when it fails to be retrieved automatically.

This is a common error that occurs in Crystal Reports. Going through this article, you will learn about the error in overview, the reasons for the error, and the solution for resolving the problem.

Overview

The Data Retrieval Error is a common error that occurs when Crystal Reports fails to retrieve data from the database. This article has highlighted a few important possible reasons that cause the data fetch error to occur. Read the complete article to understand the reasons and how to resolve them.

Reason

The following list provides the possible reasons that can cause the Failed to retrieve data from the database error to occur:

· Database Connection Failure

· Failure to Map the Table used in the Report Script

· Missing Column(s) in the database table on which the script is run

Following is the illustration showing the error:


Figure 1 Crystal Report

Solution

Follow the steps mentioned below to help resolve the database connection failure and table mapping failure errors:

It opens the Set Datasource Location dialog box which shows the current database connection.

1. Open the report in Crystal Reports Designer.

2. On the Database menu, click Set Datasource Location…

This will open the OLE DB (ADO) dialog box.

1. Go to Create New Connection OLE DB (ADO) and make a New Connection.

1. Select the Microsoft OLE DB Provider for SQL Server from the Provider list.

2. Click the [Next] button.

3. Now enter the SQL Server credentials in the Connection Information dialog box.

4. Click the [Finish] button.

5. Now map all the tables with the existing connection tables as mentioned below:

a. Select a table form the Current Data Source section and select the same table in the Replace With section, then click the [Update] button.

b. Follow the same steps for all remaining tables and update them all.

6. Once updated, click the [Close] button.

Note: To resolve the “Missing column in the database table on which the script is run” error, you need to update the column(s) directly from database being used to run the crystal report.