Reputation: 985
I have a strange (but also common) problem with Crystal Reports.
DB is SQL Server 2014 Express (12.0.2000 or 12.0.2269)
Web app can connect to DB with no problems. Problem arises when user wants to run a report.
Now, I have few production sites. A Windows Server 2012 R2 cloud VM, couple of Windows Server 2008 R2 machines and one Windows 10 machine.
Reports run fine on windows server 2008 machines, but not on server 2012 R2 or win 10. There, I get dreaded database logon failed error. It even doesn't work on my development laptop (Win 10). I mean I can run reports from within Visual Studio, but not after I deploy them to IIS.
Reports themselves mostly use sql native client (SQLNCLI11) driver for connecting to db, some of them are using OLE DB (SQLOLEDB), but that doesn't seem to be the problem since I've tried both versions, and they both fail.
Now, I would think maybe there is some dll missing in my app, but that very same app deployed to win server 2008 works just fine. So I am thinking, it must be environmental. But what?
I am guessing that client drivers are somehow broken, or something is changed in newer versions of windows.
So, I am asking for some ideas, to point me in right direction, if somebody has any.
Here is error snippet:
[COMException (0x8004100f): Database logon failed.]
CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0
CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +644
[LogOnException: Database logon failed.]
CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) +263
CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +1522
CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +704
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportOptions options) +115
CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType) +96
SYSTEM.Controllers.ReportController.GenerateReport(NameValueCollection Form, String how) in C:\SYSTEM\SYSTEM\Controllers\ReportController.cs:210
SYSTEM.Controllers.ReportController.Index() in C:\SYSTEM\SYSTEM\Controllers\ReportController.cs:467
lambda_method(Closure , ControllerBase , Object[] ) +90
UPDATE:
It seems to be due to Windows 10, but I haven't found a solution.
SAP says install .NET 3.5, because it's not installed by default in WIN 10, but even when I do, error persists.
You should install 13.0.15 version of CR, because it't the only one that supports WIN 10, but as I said, it doesn't work.
I've tested on three different WIN 10 machines, always the same result.
Upvotes: 2
Views: 3967
Reputation: 139
I've run into issues when using a OLE DB (ADO) data source type, along with a Native Client provider. When that Native Client isn't installed on the consuming user's computer, it asks for a database login, and it seems that no login will work. My solution was to use the OLE DB (ADO) data source with the OLEDB provider as well. You can see the provider by looking at the properties of the data source by right-clicking on it. The preferred provider in this case is SQLOLEDB, whereas the Native Client will be something like SQLNCLI11.
Upvotes: 3
Reputation: 1892
You must utilize SQL-Client 2005 or version 10 (I guess).
Crystal Reports is really problematic if using the most recent drivers.
Try to establish the connection using the client-driver of SQL 2005 - it will function...
Upvotes: 1
Reputation: 985
If anyone is interested, let my just share the solution:
It wasn't crystal reports, nor Windows 10, it was me. My reports were built upon SQL Server 2008, which uses SQLNCL10, and SQLNCL11 is not backwards compatible with it, hence database logon error (which is not helpful at all, btw).
Just in case.
Upvotes: 0