Hi.
I'm currently writing an applicaiton that includes some Crystal reports.
I'm attempting to use the following code to open a report:
This works fine as far as connecting to the server / database, but it wont accept the username or password, even though the rest of application is fine!
Looking through the SQL logs, it always trys to use Integrated security instead of the specified username / password.
Any ideas?
I'm currently writing an applicaiton that includes some Crystal reports.
I'm attempting to use the following code to open a report:
Code:
Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo
Dim MyReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument
MyReport.Load("C:\Reports\Report.rpt")
For Each tbCurrent In MyReport.Database.Tables
tliCurrent = tbCurrent.LogOnInfo
With tliCurrent.ConnectionInfo
.ServerName = "Server"
.DatabaseName = "Database"
.UserID = "UserName"
.Password = "Password"
End With
tbCurrent.ApplyLogOnInfo(tliCurrent)
Next
Dim frmReportViewer As New formAM_ReportViewer
frmReportViewer.CrystalReportViewer1.ReportSource = MyReport
frmReportViewer.ShowDialog()
This works fine as far as connecting to the server / database, but it wont accept the username or password, even though the rest of application is fine!
Looking through the SQL logs, it always trys to use Integrated security instead of the specified username / password.
Any ideas?