When I run my .Net Framework 4.0 web application in Visual Studio 2013 on Windows 7 it runs fine.
But when it's deployed to Windows Server 2008 R2 and I try to export my Crystal Report to I get the error 'Database logon failed'.
The database is a SQL Server 2008 R2 and the connection is made through OLEDB (ADO).
I made sure the SQL Native Client 10 was installed and that the credentials were set using: crpt.SetDatabaseLogon("user","password","server","database")
As I mentioned before it works fine on my Windows 7 machine running the development environment, but fails when deploying to Windows Server 2008 R2. I even tried deploying it to Windows Server 2012, but that didn't work either.
Does anyone have a clue? Any suggestions would be greatly appreciated.
Server Error in '/Dtt' Application.
--------------------------------------------------------------------------------
Database logon failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: Database logon failed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[COMException (0x8004100f): Database logon failed.]
CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0
CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +419
[LogOnException: Database logon failed.]
CrystalDecisions.ReportAppServer.ConvertDotNetToErom.ThrowDotNetException(Exception e) +334
CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +952
CrystalDecisions.CrystalReports.Engine.FormatEngine.ExportToStream(ExportRequestContext reqContext) +657
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export(ExportRequestContext reqContext) +208
CrystalDecisions.CrystalReports.Engine.FormatEngine.Export() +68
CrystalDecisions.CrystalReports.Engine.ReportDocument.Export() +64
DttFd.Web.PwoView.ExportToPdf(ReportDocument oRpt) +379
DttFd.Web.PwoView.Page_Load(Object sender, EventArgs e) +10943
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1025