cancel
Showing results for 
Search instead for 
Did you mean: 

CrystalDecisions.CrystalReports.Engine.LogOnException: Database logon faile

Former Member
0 Kudos
2,331

I am using a typed dataset as the data source of a report in an ASP.NET 1.1 application. The appliation works well for couple of years for 2 customers. After the same system was installed for a new customer, it brokes from time to time. What I don't understand is that why CR gives a "Database logon faile" error while it does not connect to DB directly to retrieve the data. And why it works sometime, but failed some othertime without any change to the application or environment (per customer). since this is non-reproducible in our dev envrionment, I am wondering if any one seen similar problem. You help is greatly appreciated.

We use CR XI release 2, ASP.NET 1.1. customer has windows 2003, SQL 2000 (maybe with failover cluster). thanks.

CrystalDecisions.CrystalReports.Engine.LogOnException: Database logon failed. ---> System.Runtime.InteropServices.COMException (0x8004100F): 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.ReportDocument. (ExportOptions =)

at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToStream(ExportFormatType formatType)

View Entire Topic
Former Member
0 Kudos

Hi,

When you get a database logon prompt like this it normally means the dataset you're creating at runtime does not match the schema that the report was designed with or the dataset get currupted.

The simplest thing to do is write out the dataset to XML with Schema after you fill the dataset. Once you've written out the dataset you can go back to the report in Crystal Reports itself and try to point the report to the XML file directly. If you get any errors this confirms that the dataset does not match what the report is expecting.

Try it, address any differences, and you should be all set.

Hope this will help!!

Regards,

Amit

Former Member
0 Kudos

Hi Amit,

thanks for your prompt repsponse. I will double check that. But the thing is that we do not get "database logon prompt". It just fails with "LogOnException: Database logon failed.". in addition, it does not fail all the time. We cannot even reproduce it in our dev environment.

thanks.

Wan

Former Member
0 Kudos

Hi,

Check with the [Filemon|http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx] utility when error occur.

Use the close and dispose method as it is a best practice.

Please update with the results.

Regards,

Amit

Former Member
0 Kudos

since the problem only occurs on customer's deployment server. i will ask the customer to collect the data for me.

Just wondering what is the purpose of doing this. Are there anything in particular I should ask them to watch for?

again, thank you very much for your response.

Wan Zeng