cancel
Showing results for 
Search instead for 
Did you mean: 

Crystal Reports for .NET Database Logon Failed in IIS 7.5 64 Bits

0 Kudos

I have a problem with Crystal Reports for .NET in IIS 7.5 in Windows 7 64 Bits System Operational. When I change my Application Pool to Use 32 Bits its run.

CrystalDecisions.CrystalReports.Engine.LogOnException: Database Logon Failed. ---> System.Runtime.InteropServices.COMException: 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.ExportToStream(ExportOptions options)

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportOptions options, HttpResponse response, Boolean asAttachment, String attachmentName)

   at CrystalDecisions.CrystalReports.Engine.ReportDocument.ExportToHttpResponse(ExportFormatType formatType, HttpResponse response, Boolean asAttachment, String attachmentName)

Best regards,

Accepted Solutions (1)

Accepted Solutions (1)

former_member183750
Active Contributor
0 Kudos

Posted in incorrect forum

Moved to the SAP Crystal Reports, version for Visual Studio Space.

- Ludek

SCN Moderator

former_member183750
Active Contributor
0 Kudos

Hello Jener


What version of CR are you using?

What CR Service Packs have been applied?

What version of .NET are you using?

What OS?

- Ludek

Follow us on Twitter

Got Enhancement ideas? Try the SAP Idea Place

Share Your Knowledge in SCN Topic Spaces

0 Kudos

Hi Ludek,

Thank you for answer.

I'm using the 13.0.5 CR version, I'd test with 13.0.2 too and didn't work.

I've SP5.

I'm using the Microsoft Framework 4.0.

I'd test in a Windows 7 64 Bits (pt-BR) and Windows 2008 64 Bits (en-US).

Jener

former_member183750
Active Contributor
0 Kudos

Since 32 bit compile works and 64 bit does not, I suspect you are connecting to the database via ODBC?

If that is the case, you need to create a 64 bit datasource.

If I'm off, what db are you using? What connection type? Is a 64 bit db client installed?

- Ludek

0 Kudos

Hello Ludek,

I'm using the following properties in the *.rpt file:

* Database Type: OLE DB (ADO)

* Provider: MSDAORA

* Use DSN Properties Default: False

* Locale Identifier: 1046

* OLE DB Services: -5

I've 32 Bits and 64 Bits Oracle Clients installed in the machine. Version 4.112.3.0.

I'd the following steps to try correct it:

* I'd run Oracle Universal Installer 32 Bits and I'd uninstall OLE DB Provider.

* I'd run Oracle Universal Installer 64 Bits and I'd uninstall OLE DB Provider

* I'd reboot the machine.

* I'd run Oracle Universal Installer 64 Bits and I installed OLE DB Provider again.

Unfortunately the same problem persists after this, the application runs in 32 Bits App Pool and not run in 64 Bits App Pool with Logon Failed.

Thanks,

Jener

0 Kudos

Hello,

Microsoft only has limited support for the MDAC SQL drivers. Install the MS SQL Server 2008 client tools and then select the SQLNCLI10.dll, SQL Native 10 client when you use the Set Location in the Designer to update the reports for your connections.

You also need to install the 64 bit Client tools on your Web Server to be able to use 64 bit AppPool.

Then it should all work fine.

Don

0 Kudos

Hi Don,

The company database is Oracle.

Thanks for trying to help me,

Jener

0 Kudos

Hi Jennifer.... Oops... lol long day yesterday...

Actually it is related though...

What I meant to say is why are you using the Microsoft Oracle driver if you have both Oracle clients installed?

MS's driver only supports up to Oracle 7. See this MS Kbase article for more info:

http://support.microsoft.com/kb/244661

Use Oracles OLE DB driver.

Thanks

Don

0 Kudos

Hi Don and Ludek,

Thank you very much for help me to resolve my problem.

The problem was that the used Provider was Microsoft OLE DB Provider for Oracle.

Now the report is using Oracle Server Provider. and it works well in 64 Bits Application Pool.

Best regards,

Jener

Former Member
0 Kudos

Hi Luduk,

I have a same problem : "Database logon failed"

Error occured when export to PDF file for report ..........: Database logon failed.


I am using Crystal Report 13 & vb.NET  2010  and I am using Microsoft ODBC for oracle - 32 bit  Since we are using 32 bit application.

Can you give me the suggestion / solution how can i resolve this issue with ODBC -32 bit  for 32 bit application.


By

YB

DellSC
Active Contributor
0 Kudos

First off, I would move away from the Microsoft ODBC connector to either Oracle's ODBC connector or, even better, a Native Oracle connection in your report.  The drivers from Oracle are MUCH more stable.

-Dell

Former Member
0 Kudos

I have changed ODBC in Oracle in OraHome 10g but still same error " Database Logon Failed".

DellSC
Active Contributor
0 Kudos

What code are you using to set the logons for the report?

-Dell

Former Member
0 Kudos

My codes are in below :

        Dim crRpt As New ReportDocument()

        Dim crExportOptions As New ExportOptions()

        Dim crDiskFileDestinationOptions As New DiskFileDestinationOptions()

        Dim crPDFRFTFormatTypeOptions As New PdfRtfWordFormatOptions

        Dim crCsvFormatTypeOption As New CharacterSeparatedValuesFormatOptions

       Dim crConnInfo As New CrystalDecisions.Shared.ConnectionInfo

        Dim strRpt, strFile As Object

        Dim strCurrValue As String

        Dim strReportTitle As String

        strReportTitle = ""

      

.......

        strRpt = c:\sample 1 & ".rpt"

        strFile = Filename

              

        crRpt.Load(strRpt)

        crExportOptions = crRpt.ExportOptions

        crRpt.Refresh()

        With crConnInfo

            crConnInfo.ServerName = strServer

            crConnInfo.UserID = strUser

            crConnInfo.Password = strPWD

        End With

..........

......

.......

     

        With crExportOptions

            Select Case UCase(Trim(format_Renamed))

                Case "PDF"

                    .ExportDestinationType = ExportDestinationType.DiskFile

                    .ExportFormatType = ExportFormatType.PortableDocFormat

                    .DestinationOptions = crDiskFileDestinationOptions

                    .FormatOptions = crPDFRFTFormatTypeOptions

          

                Case CStr("")

                    .......

            End Select

        End With

        If bExport Then

               crRpt.Export()

            Write2Log(strFile & " was exported successfully")

        

            ExportFile = True

        Else

           .......................

DellSC
Active Contributor
0 Kudos

I see the problems

1.  DO NOT call .refresh() until after you have set the database login and your export options.

2.  Oracle works a bit differently from everything else.  Instead of setting crConnInfo.ServerName = strServer, try crConnInfo.DatabaseName = strServer.  Also, you're not calling ApplyLogonInfo() to apply the database logon.  See http://scn.sap.com/docs/DOC-6941 for sample code on how to do this.

-Dell

0 Kudos

Microsoft's Oracle driver only support Oracle 7 and below. As Dell suggested, don't use it....

Answers (0)