Skip to Content
Former Member
Feb 14, 2007 at 08:13 AM

A CR XI and VB2005 Database Login issue


Greetings,<br /><br />I have reviewed prior threads and to no avail. Here is the situation. I have developed two applications. Both use Access 2000 datbases, Visual Basic 2005, and Crystal Reports XI Developer edition.<br /><br />Both applications use the same code. One application works, generating a report and the other pops up the &#39;Database Login&#39; screen. I am new to the programming and obiviously this stumps the bits and bytes out of me. <br /><br />Here is the code from the NON-working application.<br /><br /><br />Imports System.Configuration<br />Imports System<br />Imports System.ComponentModel<br />Imports CrystalDecisions.CrystalReports.Engine<br />Imports CrystalDecisions.Shared<br /><br />Public Class frm_Report<br /> Private r As ReportDocument<br /><br /> Private Sub Form3_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load<br /> loadreport()<br /> End Sub<br /><br /> Sub loadreport()<br /> r = New ReportDocument<br /> r.Load(glbReportName)<br /><br /> Dim crConnectionInfo As New ConnectionInfo()<br /> With crConnectionInfo<br /> crConnectionInfo.ServerName = glbDatabaseName<br /> crConnectionInfo.ServerName = glbRetirementDatabaseName<br /> crConnectionInfo.ServerName = glbSupportDatabaseName<br /> End With<br /><br /> Dim myTable As CrystalDecisions.CrystalReports.Engine.Table<br /> Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo<br /> For Each myTable In r.Database.Tables<br /> myLogin = myTable.LogOnInfo<br /> myLogin.ConnectionInfo = crConnectionInfo<br /> myTable.ApplyLogOnInfo(myLogin)<br /> Next<br /> CrystalReportViewer1.SelectionFormula = glbSelectionFormula<br /><br /> CrystalReportViewer1.ReportSource = r<br /> End Sub<br />End Class<br /><br /><br />Thanks for any pointers, comments, hints, or anything....