Вы находитесь на странице: 1из 7

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .

NET Applications

Applies to:
Crystal Reports 9.1 to Crystal Reports 2008 (12.0.x) when used in applicable versions of Visual Studio .NET.

Summary
This article discusses troubleshooting techniques, tips, and best practices that should lead to quick resolution of database connectivity issues of deployed applications when Crystal Reports is used as a reporting tool. Applies to all versions of Microsoft Visual Studio .NET using the Crystal Reports SDK for VS .NET. Author: Ludek Uher

Company: SAP Created on: 20 November 2009

Author Bio
Ludek Uher is a Senior Engineer with Technical Customer Assurance, SAP BusinessObjects. He specializes in the SDKs supplied with Crystal Reports and BusinessObjects Enterprise.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 1

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications

Table of Contents
Introduction ................................................................................................................................................... 3 Possible Errors and Problem Behaviors ........................................................................................................ 3 Troubleshooting Steps .................................................................................................................................. 3 Related Content ............................................................................................................................................ 6 Copyright ...................................................................................................................................................... 7

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 2

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications

Introduction
Database connectivity with Crystal Reports is a huge topic. This article is intentionally limited to troubleshooting issues with Crystal Reports when used in Microsoft Visual Studio .NET applications. Another limitation is that the application must work as expected in the development environment, but is failing once the application is distributed to another computer. For example, if you are having database connectivity issues in your Visual Studio .NET application on your development computer, this article does not apply. Issues with ADO .NET datasets are not discussed in any detail as these are addressed in the Troubleshooting Issues with VS .NET Datasets and Crystal Reports blog post. Web and Windows Services as well as dataset DLLs are also not discussed in this article.

Possible Errors and Problem Behaviors


The following is a list of possible error messages and behaviors. The list is not exhaustive, but does cover most common errors and behaviors. Unknown Database Connector Error Error in File C:\WINDOWS\TEMP\Report1003 {guid ...}.rpt: Unknown Database Connector Error CrystalReportViewer - CrystalReportViewer1 Error: Object reference not set to an instance of an object. Failed to load database error. Error in file myReport C:\DOCUME~1\DMTEST\ASPNET\LOCALS~1\Temp\test {guid ...}.rpt CrystalDecisions.CrystalReports.Engine.InternalException Message: Failed to open the connection. Failed to open the connection. myReport {guid ...}.rpt Database vendor code xxx Unknown Query Engine ErrorError in File C:\temp\temp_{guid ...}.rpt: This field name is not known. Error in File C:\DOCUME~1\hsimpson\LOCALS~1\Temp\ExcessiveWriteOffs {guid ...}.rpt: Error in formula <Formula_Name> ConnectionInfo.ServerName threw an exception of type 'System.ArgumentException' Query Engine Error: {guid ...}.rpt Failed to load database information. Error in File temp_{guid ...}.rpt: Failed to load database information. Details: The database DLL 'crdb_oracle.dll' could not be loaded. Error in File C:\DOCUME~1\DMTEST\ASPNET\LOCALS~1\Temp\test {guid ...}.rpt: Failed to load database information Looping logon Database fields stripped or not visible no error.

Troubleshooting Steps
1. As mentioned in the introduction, ensure that the application works on your development system. Thoroughly test the application ensuring that you are not using reports with Saved Data. If you are planning to change to another data source at runtime, test the change on your development system before deploying the application. For example, create a test ODBC, or OLE DB data source. If you will be changing to different databases create a test database and test your application with it. Do not deploy your application if you are not sure it works on your development computer. 2. Before proceeding to steps 3 and higher, consider installing the Crystal Reports Designer on the computer where the application is deployed. This is only for testing purposes. Once troubleshooting is completed, uninstall the designer. Open the report in the designer and see if it can connect to the database. This is particularly useful test if you are changing data sources. Often, if there is a database connectivity issue, the report designer will provide better error messages, or other clues (Field Mapping dialog) that will help you in troubleshooting the issue.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 3

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications

An evaluation version of Crystal Reports 2008 can be downloaded from the SAP BusinessObjects Get a Free Trial or Buy Now page. 3. Remain open to the possibility that it may be the code that is not passing the correct database logon parameters to the report. Double check and then triple check this possibility. As a test, hard coding the values is never a bad idea. Remember that some databases may be case sensitive. Oracle would be one example of case sensitivity. 4. Ensure you have applied the latest Crystal Reports Service Pack applicable to the version of Crystal Reports. Ensure that you are deploying the Crystal Reports runtime of the same Service Pack level. Service Packs can be found on the SAP BusinessObjects Software Downloads page. Crystal Reports runtime download links are documented in the "Crystal Reports v. 9.1 to 12.x VS .NET Runtime Distribution & Supported Operating Systems wiki. 5. Enable the options Verify on First Refresh and Verify Stored Procedures on First Refresh. These options can be found under the File menu > Report Options. These options are report specific. Reports expect all data to match the schema or database structure they were created with. The above options will often resolve minor schema or structure differences.
Note: these options depending on the code used and the architecture of your application may cause issues once the database has been verified (slightly longer report processing times would be one example).

It is recommended that if these options resolve the issue, export the report to .rpt file format. Then open the report in the designer, and turn off the options. 6. If the conditions in steps one and two have been satisfied, ensure that the correct database client is installed. This includes any fixes and Service Packs. A typical behavior when a database client is missing or incorrectly configured includes the report prompting for the username and password even if proper logon code is provided from .NET application. The logon prompt, Database Name field is empty, grayed out and disabled. Forcing the report to view by clicking the OK button, produces the error Logon Failed. One of the best ways to determine if the correct runtime is installed, Crystal Reports, database client and other is to use the Modules utility. Use the utility to compare runtime loaded on the development computer and the client computer.
Note: This step should be considered even if other applications or even the same application can connect to the database. Crystal Reports is sensitive to the correct client being installed.

7. If using ODBC, ensure the correct ODBC datasource is created and that it is a system DSN. Check to see if any other application is able to connect to the datasource. If using OLE DB connections, create a UDL file and see if you can connect to the datasource using the UDL file. 8. If deploying a 64-bit application to 64-bit operating systems, ensure that database client is 64-bit. If using 64-bit ODBC, verify the ODBC datasource is configured as 64-bit. At this time only two versions of Crystal Reports are 64-bit: Crystal Reports 10.2 which bundles with Visual Studio .NET 2005 and Crystal Reports 10.5 (Crystal Reports Basic for Visual Studio 2008) which bundles with Visual Studio .NET 2008. For more details regarding Crystal Reports and 64-bit operating systems, see the article Crystal Reports support of 64-bit Operating Systems. 9. For the error "Database vendor code xxx", use the database documentation, or use Google to look up the error. "Database Vendor Code" means that this is the error code coming from the database. 10. Errors or no data when using ADO .NET datasets are invariably due to an incorrectly formatted dataset. Crystal Reports expects the dataset to match exactly the data schema used to create the report. To troubleshoot issues when using datasets, see the blog post Troubleshooting Issues with VS .NET Datasets and Crystal Reports. 11. An error regarding crdb_oracle.dll missing ('crdb_oracle.dll' could not be loaded), will usually occur when deploying an application that references Crystal Reports 10.2 or 10.5, and the report was created in an earlier or later version of Crystal Reports. The crdb_oracle.dll is not part of Crystal Reports 10.2 or Crystal Reports 10.5. To see what version of Crystal Reports your report was created in, open the report in the designer. Go to the Report menu and select Performance Information.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 4

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications

12. Using an XML file as a datasource will result in the error "Failed To Load Database Information" on client computers. This is due to the fact that the database driver crdb_xml.dll is not part of any Crystal Reports runtime deployment. This is by design as the driver crdb_xml.dll has dependencies on the Java Runtime Environment. The Java Runtime Environment is not included in any Crystal Reports merge modules or MSI files. For information on how to configure client systems that use crdb_xml.dll, see the blog post How to deploy Crystal Reports 2008 runtime for .NET when the report is connecting to XML files. 13. The Crystal Reports drivers crdb_xml.dll, crdb_jdbc.dll and crdb_sforce.dll have a known issue when used in a Visual Studio .NET application. Typical behavior results in the application hanging, or "Database logon failed" error. Stopping the java.exe process after the error occurs and rerunning the report may work for a run or two but the error will inevitably return. 14. If you are deploying a web application, make sure the account that is running the application has access to the database directory. Ensure the account has at least read/write permissions to the system temp folder. Use the Process Monitor utility to determine if permissions are an issue. Once you have a Process Monitor log, search for Access Denied.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 5

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications

Related Content
Sample applications using the Crystal Reports SDK for Visual Studio .NET Sample applications using the Report Application server SDK for Visual Studio .NET Report Application Server Database Connectivity Wiki Support search page Articles page

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 6

Troubleshooting Guide to Database Connectivity Issues with Crystal Reports in Visual Studio .NET Applications

Copyright
Copyright 2009 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Serv er, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentio ned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsi us, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable fo r errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituti ng an additional warranty.

SAP COMMUNITY NETWORK 2009 SAP AG

SDN - sdn.sap.com | BPX - bpx.sap.com | BOC - boc.sap.com 7

Вам также может понравиться