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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logon failed in my subreports

Status
Not open for further replies.

deliutza

Programmer
Feb 9, 2005
8
RO
I have a Crystal Report.Net in an ASP.Net webform. Initially I set the data source of my report document to a dataset generated from a SQL query.
Everything worked fine. Then I added two subreports in the report document that is directly linked to a table in the database.
Now it gives me this error " Logon Exception:
CrystalDecisions.CrystalReport­s.Engine.LogOnException: Logon failed. "
I try to create a procedure like this:

Public Sub LogonToDatabase(ByVal ReportTables As CrystalDecisions.CrystalReports.Engine.Tables, ByVal UserId As String, ByVal Password As String)
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myConnectionInfo As New CrystalDecisions.Shared.ConnectionInfo
Dim myLogonInfo As New CrystalDecisions.Shared.TableLogOnInfo
With myConnectionInfo
'.ServerName = "myServer"
.DatabaseName = "mydatabase"
.UserID = UserId
.Password = Password

End With
myLogonInfo.ConnectionInfo = myConnectionInfo

For Each myTable In ReportTables
myTable.ApplyLogOnInfo(myLogonInfo)
Next
End Sub

This doesn't work!

Thanks in advance for any reply!

 
Why is your servername commented out?

My inclination is that one of the tables in question has permissions set differently than you need them to be. What do you know about these permissions.

Scott.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top