
Logon failed. Crystal Reports .NET
I have the exact same "Logon failed" problem with
Crystal Reports .NET. It
works fine when I use SQL Authentication but it fails with Windows
Authentication connecting to a remote SQL server. I have to use Windows
Authentication because we are impersonating the user at IIS before
connecting to the SQL server.
I added the ASPNET user and our impersonated user to the database with the
public, owner, reader and writer permissions but it didn't make any
difference. I defined a DSN for the connection, and used it rather than
making an OLEDB connection but it didn't help either. The connection is all
right during design-time but it fails at run-time.
I know that this problem has already been mentioned in different newsgroups
with several workarounds that I compiled in the previous paragraph. However,
neither of them solved my problem.
Thanks in advance,
Yilmaz
Quote:
> Anders,
> I think I have finally found your problem. Are you by any chance using
> Integrated Security? If so you need to make sure that the ASPNET user on
> the webserver has access to the SQL database.
> I was able to replicate the error that you described. And by adding the
> ASPNET user to the database, and for testing purposes I gave it owner
> access, the report ran successfully.
> Hope this is of some help to you.
> Robert Johnson
> Microsoft ASP.NET Developer Support
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> --------------------
> Content-Class: urn:content-classes:message
> I'm successfully able to display reports in a ASP.NET page
> (VS.NET final version)
> The SQL datasource is an Access or another source without
> password.
> However when i'm changing database source to Oracle or
> SQL2000 server, the
> ASP.NET page will throw an exception (see below).
> Now, I know that the DB connect is successful as a it
> connects properly in design mode
> and displays data and tables in design mode. However, when
> browsing it will generate the following error:
> -----------------------------------------------------------
> 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:
> CrystalDecisions.CrystalReports.Engine.LogOnException:
> Logon failed.
> Stack Trace:
> [LogOnException: Logon failed.]
> . K(String
> , EngineExceptionErrorID
> ) +546
> . F(Int16 , Int32 ) +491
> CrystalDecisions.CrystalReports.Engine.FormatEngine.GetPage
> (PageRequestContext reqContext) +459
> CrystalDecisions.ReportSource.LocalReportSourceBase.GetPage
> (PageRequestContext pageReqContext) +189
> CrystalDecisions.Web.ReportAgent.v(Boolean `) +150
> CrystalDecisions.Web.CrystalReportViewer.OnPreRender
> (EventArgs e) +108
> System.Web.UI.Control.PreRenderRecursiveInternal() +62
> System.Web.UI.Control.PreRenderRecursiveInternal() +125
> System.Web.UI.Control.PreRenderRecursiveInternal() +125
> System.Web.UI.Page.ProcessRequestMain() +1470
> -----------------------------------------------------------
> I suspect that the Database username and password is not
> stored in the report, so i'll
> have to provide this at runtime. Now, how will i do this??
> Thanks,
> Anders