Crystal report. Logon failed to MS SQL Server

E

Eje

I try to make my first report but when I try to open it
in the browser I get the message Logon failed. I have MS
SQL Server, VS.NET 2002 with SP2 and Windows XP. During
the development I use Integrated security.
CrystalDecisions has an article (c2010371), not for
integrated security, which suggested the following
solution that didn't solve my problem:

Private Sub Page_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load

Dim crtableLogoninfos As New TableLogOnInfos()
Dim crtableLogoninfo As New TableLogOnInfo()
Dim crConnectionInfo As New ConnectionInfo()
Dim CrTables As Tables
Dim CrTable As Table
Dim TableCounter As Integer
Dim crReportDocument As New report1()

With crConnectionInfo
.ServerName = "severname"
.UserID = "userid"
.Password = "password"
.DatabaseName = "databasename"
End With

CrTables = crReportDocument.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(CrTable.LogOnInfo)
Next

CrystalReportViewer1.ReportSource = crReportDocument

End Sub

Private Sub CrystalReportViewer1_Init(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
CrystalReportViewer1.Init

End Sub

Just now I have no more ideas so if anyone could help me
I would :)

Eje
 
G

Guest

I had the same problem. If you are using Integrated Security you don't need any of

With crConnectionInf
.ServerName = "severname
.UserID = "userid
.Password = "password
.DatabaseName = "databasename
End Wit

CrTables = crReportDocument.Database.Table
For Each CrTable In CrTable
crtableLogoninfo = CrTable.LogOnInf
crtableLogoninfo.ConnectionInfo = crConnectionInf
CrTable.ApplyLogOnInfo(CrTable.LogOnInfo
Nex

In Field Explorer in the IDE right click on Database Fields and Verify Database - I think it gives you the option to update the report to Integrated NT Security which sould solve your problem.
 
G

Guest

Thanks Geoff for your help. Unfortunately there are no
options under Verify Database and I haven't found any
suitable option at all under Database Fields.

Eje
-----Original Message-----
I had the same problem. If you are using Integrated
Security you don't need any of :
With crConnectionInfo
.ServerName = "severname"
.UserID = "userid"
.Password = "password"
.DatabaseName = "databasename"
End With

CrTables = crReportDocument.Database.Tables
For Each CrTable In CrTables
crtableLogoninfo = CrTable.LogOnInfo
crtableLogoninfo.ConnectionInfo = crConnectionInfo
CrTable.ApplyLogOnInfo(CrTable.LogOnInfo)
Next

In Field Explorer in the IDE right click on Database
Fields and Verify Database - I think it gives you the
option to update the report to Integrated NT Security
which sould solve your problem.
 
G

Guest

Definately works for me - I've just tried it again. Comment out all your Connection info code. Display your crystal report in the IDE. On the left, right click "Database Fields" in Field Explorer - Click on Verfiy database and after a few seconds you should get a screen giving you the option to change the connection to integrated security by putting a tick in a box. If ths doesn't work then your problem must lay elsewhere e.g. is your SQL Server running?
 
A

Ayaz Ahmed

Hello,

Just change report source name.

i Hope its working fine.


Warm Regards,

Ayaz Ahmed
Software Engineer & Web Developer
Creative Chaos (Pvt.) Ltd.
"Managing Your Digital Risk"
http://www.csquareonline.com
Karachi, Pakistan
Mobile +92 300 2280950
Office +92 21 455 2414
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top