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!

SQL Logon Problems...

Status
Not open for further replies.

DTJeff

Programmer
Dec 9, 2003
37
GB
Hi.

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?

 
Sorry, I forgot to mention all that.

I'm using VB.Net, with the version of crystal that comes with it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top