MyLifeServices
ISP
Greetings,
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.
Both applications use the same code. One application works, generating a report and the other pops up the 'Database Login' screen. I am new to the programming and obiviously this stumps the bits and bytes out of me.
Here is the code from the NON-working application.
Imports System.Configuration
Imports System
Imports System.ComponentModel
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class frm_Report
Private r As ReportDocument
Private Sub Form3_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
loadreport()
End Sub
Sub loadreport()
r = New ReportDocument
r.Load(glbReportName)
Dim crConnectionInfo As New ConnectionInfo()
With crConnectionInfo
crConnectionInfo.ServerName = glbDatabaseName
crConnectionInfo.ServerName = glbRetirementDatabaseName
crConnectionInfo.ServerName = glbSupportDatabaseName
End With
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
For Each myTable In r.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo = crConnectionInfo
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.SelectionFormula = glbSelectionFormula
CrystalReportViewer1.ReportSource = r
End Sub
End Class
Thanks for any pointers, comments, hints, or anything....
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.
Both applications use the same code. One application works, generating a report and the other pops up the 'Database Login' screen. I am new to the programming and obiviously this stumps the bits and bytes out of me.
Here is the code from the NON-working application.
Imports System.Configuration
Imports System
Imports System.ComponentModel
Imports CrystalDecisions.CrystalReports.Engine
Imports CrystalDecisions.Shared
Public Class frm_Report
Private r As ReportDocument
Private Sub Form3_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
loadreport()
End Sub
Sub loadreport()
r = New ReportDocument
r.Load(glbReportName)
Dim crConnectionInfo As New ConnectionInfo()
With crConnectionInfo
crConnectionInfo.ServerName = glbDatabaseName
crConnectionInfo.ServerName = glbRetirementDatabaseName
crConnectionInfo.ServerName = glbSupportDatabaseName
End With
Dim myTable As CrystalDecisions.CrystalReports.Engine.Table
Dim myLogin As CrystalDecisions.Shared.TableLogOnInfo
For Each myTable In r.Database.Tables
myLogin = myTable.LogOnInfo
myLogin.ConnectionInfo = crConnectionInfo
myTable.ApplyLogOnInfo(myLogin)
Next
CrystalReportViewer1.SelectionFormula = glbSelectionFormula
CrystalReportViewer1.ReportSource = r
End Sub
End Class
Thanks for any pointers, comments, hints, or anything....