SAP Knowledge Base Article - Public

1766123 - Error: "Database logon failed."

Symptom

  • A Crystal Reports .NET windows application to view a report fails with below error message on a client machine.

CrystalDecisions.CrystalReports.Engine.LogOnException: Database logon failed. ---> System.Runtime.InteropServices.COMException: Database logon failed.
at CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export (ExportOptions pExportOptions, RequestContext pRequestContext)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream (ExportRequestContext reqContext)
--- End of inner exception stack trace ---
at CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException (Exception e)
at CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream (ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext)
at CrystalDecisions.CrystalReports.Engine.FormatEngine.Export (ExportRequestContext eqContext)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToDisk(ExportFormatType formatType, String fileName)

  •  Application works fine on development machine.

Environment

  • Visual Studio 2010
  • Crystal Reports for Visual Studio 2010
  • SQL Server 2008
  • Crystal report connects to database using OLEDB connection.

Cause

  • OLEDB drivers on the client machine are corrupted.
  • OLEDB drivers are not installed by Crystal Reports but the Operating System itself.

Resolution

  • Repair the windows installation on the client machine to make sure the OLEDB drivers are functioning properly.
  • As a workaround, change the Crystal Reports connectivity from OLEDB to ODBC.

Keywords

bi, sap, beginner, business_intelligence_(businessobjects), sap_crystal_reports, visual, for, .net, crforvs, crvs2010, studio, sdk, crystal_reports, cr.net, cr, formula, crystal_reports_for_visual_studio_2010, _version_for_visual_studio_.net, business_intelligence_(business, crystal_reports_2008, reportformula, reportformulatable, conditionformulas, crystal_report, code_resuability, crvs, cr2008, ras.net , KBA , BI-DEV-NET , BI Software Development Kits (SDKs) - .NET or Other , Problem

Product

SAP Crystal Reports, developer version for Microsoft Visual Studio