Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon Failed

Status
Not open for further replies.

neilkonitzer

Programmer
Jun 27, 2001
168
US
I've read dozens of articles regarding a "Logon Failed" message that I keep receiving, but no solution has been provided that works. Hopefully, the Tek-Tips experts will prevail!

I have developed an ASP.NET application that uses a series of Crystal Report 9 reports that I have successfully created and can open on my development machine with no problems at all.

The problem is that when I deploy the application, I keep receiving the following error:

CrystalDecisions.CrystalReports.Engine.LogOnException: Logon failed.

After stepping through the code, I know that the viewer has successfully loaded the report. Somehow, it appears that the database credentials that I am passing in do not appear to be working. I have manually opened the reports on the same web server in Crystal Reports and can connect no problem. The reports will only not load when run in the context of my web application.

For further information, I am not using Windows Authentication, I am passing the SQL credentials in my ASP.NET code. Here is an example:

Dim crpt As New ReportDocument
Dim mytable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
Protected WithEvents CRViewer As CrystalDecisions.Web.CrystalReportViewer

crpt.Load("C:\inetpub\
For Each mytable In crpt.Database.Tables
myLogin = mytable.LogOnInfo
myLogin.ConnectionInfo.ServerName = "server"
myLogin.ConnectionInfo.DatabaseName = "database"
myLogin.ConnectionInfo.Password = "password"
myLogin.ConnectionInfo.UserID = "user"
mytable.ApplyLogOnInfo(myLogin)
Next

CRViewer.ReportSource = crpt
CRViewer.DataBind()

Remember, these reports have no problem opening up in the application on my development machine. It is only when deployed.

I know that there are many other developers that have had this problem. I am hoping that someone holds the key to the solution.

Thanks in advance!

Neil Konitzer
Freisoft
 
For inquiring minds, the solution has been found...

The problem turned out to be a problem with the web server where the application was deployed. Even though the web server could ping the database server with no problems, there was a problem associated with the web server using "Named Pipes" to connect to the database. Once this was resolved, the deployed application worked fine.

Neil Konitzer
Freisoft
 
....agreed.
Change the connection type from "Named Pipes" to "TCP/IP" and that should take care of the issue.
Luck.
-D.

Misce stultitiam consiliis brevem...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top