Crystal Reports: Database Logon Failed

前端 未结 5 760
感动是毒
感动是毒 2021-01-27 00:02

I have application in ASP.NET (C#) in which I use Sap Crystal Reports for Visual Studio. In VS everything works perfect. But when I deploy it to IIS \"Database Logon Failed\" er

相关标签:
5条回答
  • 2021-01-27 00:13

    We had similar issue/error message: CR worked fine on most PCs including production server but on one particular dev. PC it did not. We checked Database Sources drivers and "SQL Native Client" was missing while "SQL Server Client" and "SQL Server Native Client" were present. We installed version 2005 from here http://www.microsoft.com/en-us/download/details.aspx?id=11988 (for 64-bit OS) and it started working.

    0 讨论(0)
  • 2021-01-27 00:15

    Thank you everyone for your time.

    I used User DSN before and I had "Failed to open the connection. Failed to open the connection 'report name'.rpt" when I deployed my application. Afterwards I changed it to SystemDSN. Previous error was gone but this time "Database Logon failed" error occured.

    Finally I have solved my problem by changing connection form System DSN to Oracle Server. Everything works very well now. Consider this if you have same problem.

    0 讨论(0)
  • 2021-01-27 00:20

    Connection string error. your code update with this steps:

    1.clear dataset connection.
    2.set table or tables.
    3.don't set datasource and dataset. becuase you sent data in tables to crystal report and do not need to connect to server or database.
    4.refresh the reportdocument.
    for example:

    MyCrystalReportSource.ReportDocument.DataSourceConnections.Clear();
    MyCrystalReportSource.ReportDocument.Database.Tables[0].SetDataSource(MyDataSet.Tables[0]);
    MyCrystalReportSource.ReportDocument.Refresh();
    MyCrystalReportSource.ReportDocument.ExportToHttpResponse(ExportFormatType.PortableDocFormat, HttpContext.Current.Response, true, reportTitle);
    
    0 讨论(0)
  • 2021-01-27 00:21

    I had an awful time with this Crystal issue, the report worked locally and on another server, but would not work on our production environment.

    The issue was SQL Native client not being installed on the Prod server. We modified the reports to use OLEDB.

    Report Designer -> 
    Right Click on Background -> 
    Database -> 
    Set Datasource location -> 
    In the 'Replace With:' section, Create a New Connection using OLE DB (ADO) -> 
    Microsoft OLE DB Provider for SQL Server
    

    We had been selecting SQL Server Native Client 11.0, and this was causing the error on deployment.

    Prior to this, I had tried everything, x86/x64, app pool changes, installing crazy versions of Crystal 13, this was it.

    0 讨论(0)
  • 2021-01-27 00:35

    Ugh, Oracle. :) Typically I don't use System DSN's with Crystal, but for Oracle it's been the only way I've been able to get it to connect. As I recall, you will need to make sure that the DSN for Oracle is setup on the server in the "32-bit ODBC Data Soruce Administrator". That's been the only way I've been able to successfully get Oracle to connect via Crystal.

    Via .Net (C# or VB), that's another story. I don't think you're App Pool identity is going to matter in this case since you're probably going to be using an Oracle username/password to connect.

    90% of questions I answer deal with Crystal Reports and changing connection information. I have some code I use in a wrapper that works for me in this blog post:

    http://www.blakepell.com/2012-05-22-crystal-reports-extension-methods

    The username is the oracle username, the password is the oracle password, the server name however is the name of the DSN. Don't ask me why, but that always works for me. :p

    0 讨论(0)
提交回复
热议问题