Showing results for 
Search instead for 
Did you mean: 

Failed to Retrieve Information from the Database

Former Member
0 Kudos

Background: I've got a C# application which utilizes the Crystal Report Engine for .NET Framework 4.0 (Code below). The Crystal Reports it connects to access Oracle directly, but my application feeds them the connection string they are to use. There are 60+ reports that my application cycles through.

As I understand it there are two pieces to that, one being the Crystal Report must be set to the Data Source using the same account details as the connection string, the other being the connection string passed in.

When the Crystal Report and Application use the Schema Owner as the connection string the application works fine. It cycles through all of the reports, and prints them out.

When I use a different user account (which is limited to only what this application needs) it fails on the second report. Not the first report. The first report works just fine, and the second report gets the below error: Message: Failed to retrieve data from the database. Details:  [Database Vendor Code: 942 ] Failed to retrieve data from the database. Error in File [Crystal Report Name]

What I find strange is that the first and second report are identical in terms of which Oracle Objects they utilize.

Does Crystal Report Engine require any special permissions beyond Select? Is there potentially something else amiss?

//CR is an Instance of ReportDocument class, DBCnnctn is a class that pulls Connection info from an XML file

cr.Load(sReportPath + ReportName);

//Set the connection Info to be what is stored in the global variables and apply them to all the tables in the

//report, and all tables in each sub report

crConnectionInfo.ServerName = DBCnnctn.sDS;

crConnectionInfo.DatabaseName = "";

crConnectionInfo.UserID = DBCnnctn.sUID;

crConnectionInfo.Password = DBCnnctn.sPW;

cr.RecordSelectionFormula = rSelFormula + CycleNum;

cr.SummaryInfo.ReportTitle = CycleNum + " " + ReportName;

SetDBLogonForReport(crConnectionInfo, cr);

SetDBLogonForSubReport(crConnectionInfo, cr);

rpt.ReportSource = cr;



cr.PrintOptions.DissociatePageSizeAndPrinterPaperSize = false;

cr.ExportToDisk(ExportFormatType.PortableDocFormat, ReportName + CycleNum + ".pdf");


If there are any additional details that I can provide to help, let me know.

View Entire Topic
Active Contributor
0 Kudos

Hi Thomas

The eror is being passed from the db client through the report engine unmodified. So searching for the error in the Oracle documentation will be a good idea. Doing a bit of googling on the error it appears to resolve to either table does not exist or table cannot be accessed. If it is an access issue, you will have to try and figure out why. Also, see the following:

1767703 - Error: [Database Vendor Code: 942 ] Failed to retrieve data from the database

- Ludek

Senior Support Engineer AGS Product Support, Global Support Center Canada

Follow me on Twitter