I have a bunch of Crystal reports for a system that I have moved to VS2008. Calling the report works. However, I get a dialogue box asking for the password. It has the user code filled in properly. What am I missing in this code? I am passing the username as well as the password.
Code:Private Sub optTooling_CheckedChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles optTooling.CheckedChanged If eventSender.Checked Then Try Dim intCounter As Integer Dim ConInfo As New CrystalDecisions.Shared.TableLogOnInfo ConInfo.ConnectionInfo.UserID = "sa" ConInfo.ConnectionInfo.Password = "pacjo" ConInfo.ConnectionInfo.ServerName = "Primero" ConInfo.ConnectionInfo.DatabaseName = "Tooling" Dim objReport As New CrystalDecisions.CrystalReports.Engine.ReportDocument CrystalReportViewer1.ReportSource = "I:\VB NET Source Code\TOOLING_NET\FullToolList.rpt" For intCounter = 0 To objReport.Database.Tables.Count - 1 objReport.Database.Tables(intCounter).ApplyLogOnInfo(ConInfo) Next Exit Sub Catch ex As Exception System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Default MsgBox("An error occurred: " & ex.Message & " - Source: (frmreports)optTooling_CheckedChanged") End Try End If End Sub




Reply With Quote