Crystal Reports + IIS 7.5 Move -> Database logon failed RRS feed

  • Question

  • User-2081167373 posted

    I'm sorry if this is the wrong section and should be in the IIS part, but I figured since the error only happens when running something made in Crystal that it might be the right spot.

    Any, we have been in the middle of a server move from W2003 over to W2008 R2 and everything on the site works fine, except all the reports we have done in Crystal.  I have tried reloading the install and even loading two newer versions, but it always gives the same error.  The big kicker to this is our web developer kind of "quit" right in the middle of all of this and I am no developer. 

    We always get the [COMException (0x8004100f): Database logon failed.] error.  I have tried it with our old server using the new database and that is fine, so it seems the database isn't having the issue.  If I open the report in Crystal it works fine - verify the database connection and everything. 

    If any other information is needed I will provide what I can - I've been trying to work on this for a week and gotten no where!  Frown

    Here is the error that comes up:

    Server Error in '/v2' 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:

    Line 74: 
    Line 75:         Catch ex As Exception
    Line 76: Throw ex 
    Line 77: End Try Line 78:

    Source File: D:\inetpub\generic\GetParms.aspx.vb    Line: 76

    Stack Trace:

    [COMException (0x8004100f): Database logon failed.]
       CrystalDecisions.ReportAppServer.Controllers.ReportSourceClass.Export(ExportOptions pExportOptions, RequestContext pRequestContext) +0
       CrystalDecisions.ReportSource.EromReportSourceBase.ExportToStream(ExportRequestContext reqContext) +260
    [LogOnException: Database logon failed.]
       chem_GetParms.Page_Load(Object sender, EventArgs e) in D:\inetpub\generic\GetParms.aspx.vb:76
       System.Web.UI.Control.OnLoad(EventArgs e) +99
       System.Web.UI.Control.LoadRecursive() +50
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

    Version Information: Microsoft .NET Framework Version:2.0.50727.5420; ASP.NET Version:2.0.50727.5420

    Tuesday, December 13, 2011 3:40 PM

All replies

  • User197322208 posted

    replace  the

    throw ex



    ( or better, remove all try /catch )

    and make another test

    Wednesday, December 14, 2011 12:16 AM
  • User-2081167373 posted

    Tries, but makes no difference - still the same error - [COMException (0x8004100f): Database logon failed.]

    Wednesday, December 14, 2011 12:03 PM
  • User197322208 posted

    and what's the line now?

    Wednesday, December 14, 2011 2:25 PM
  • User-2081167373 posted

    Exactly the same, but instead of Throw ex is stops on Throw.  If I remove the try /catch still the same error.  Might need to look in the for hire section and get this figured out  Laughing

    Wednesday, December 14, 2011 3:10 PM
  • User-2081167373 posted

    I decided to check some other reports and it seems not all are broken - 9 work fine and 7 give that error.  The weird part is they are all about the same - so at least that gives me some hope that it is really just something simple

    Edit - well, it seems all the reports that used a DSN no longer worked and gave that error, even though the DSN was remade.  Changing everything to MS OLEDB for SQL and boom, works.  Not sure why they broke, but atleast there is a fix for now1

    Wednesday, December 14, 2011 4:37 PM
  • User699767472 posted

    I have resolved the issue by adding system odbc data source for 32 bit.


    Adding the datasource connection resolved the issue.

    We should also be able to run the applicaiton on .net 4.0 framework.

    Thursday, April 11, 2013 12:03 PM
  • User-1064270768 posted

    First the solution. Hope this helps. It definitely helped me resolve this issue. We need to check the Application Pool Identity settings for the web application we deployed in IIS.

    Under IIS Application Pools. Check the Advanced Settings for the application pool you selected for your web application.

    Make sure it runs under Administrator because Crystal reports are loaded from Windows\temp folder and we need to have rights to access this folder in order for the report to be loaded in viewer at runtime. Also make sure you have the runtime installed for .Net Framework 4 on the server.

    This setting needs to be done only if IIS is on a remote server. If IIS and Database are on same machine, this setting is not needed. The application pool can then run merely as a Local service. 

    Crystal reports runs fabulously both in standalone and web applications. It is easy to use and simple. I loved it until this issue came up. Tried every tip and solution suggested in various forums on the Internet developers community but to no avail. 

    After banging my head for over a month I found the solution by trial and error for displaying the crystal report in my web application. And I love Crystal Reports back again. :)

    Even I have been victim of this Database Logon Failed Error. My web application built on .NET framework 4 and using Crystal Reports 13 with the report displaying data on the push method model was running fine on both IIS 7.5 and Visual Studio 2010. The application was built on 64 bit machine with 32 bit application mode enabled in IIS settings. But all of a sudden started getting Database Logon message when trying to view a crystal report by accesing the application through IIS.

    The report was displaying fine when running in Visual Studio but the moment I deploy the web application in IIS and browse it in Internet explorer from IIS / local server / remote client machines, crystal report refused to show up without any error. Simply this message - "Database Logon Failed" comes up on the screen where report is supposed to come up in crystal report viewer. Initially I doubted that some data in dataset is missing thats why this message is coming. But that was not the case. I printed the dataset on live application run in logs and checked. Data was all fine.

    It is all because of IIS settings.

    Database Logon Failed error was coming though I was using the push method with xsd dataset population.

    I was not connecting to database at runtime either yet I was getting Database Logon Failed error.

    All dataset data was coming into the report display page but somehow the report failed to show up in the Crystal report viewer.

    Thursday, May 8, 2014 3:01 AM
  • User-232250215 posted

    I had the same error message with a similar scenario.  One report out of 4 worked fine. The other three gave me a DB logon error.  I opened the offending three reports and ran the verify DB.  It prompted me for credentials again, and I provided them.  Save and compiled and now the three reports act as they should.

    Tuesday, August 26, 2014 8:08 AM