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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A CRXI and VB2005 Database login issue

Status
Not open for further replies.
May 26, 2001
15
0
0
US
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...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top