I am having a problem trying to figure out how to have a report connect to two databases. I have one db that contains tooling data, but I also need to connect to another db that has product description data. I thought I might be able to do this:
VB Code:
Case "Z:\Tooling\Xref.rpt" ReportPath = Application.StartupPath & "\Xref.rpt" CRViewer1.ReportSource = ReportPath Dim myTableLogOnInfos As TableLogOnInfos = CRViewer1.LogOnInfo For Each myTableLogOnInfo As TableLogOnInfo In myTableLogOnInfos If report.name = "Unprinted" Then myTableLogOnInfo.ConnectionInfo = myConnecionInfo2 Else myTableLogOnInfo.ConnectionInfo = myConnecionInfo End If Next
That does nto seem to be working. I can't seem to find out how to determine the table name that it is trying to cvonnect to. Also, it is telling me that myConnectionInfo & myConnectionInfo2 are not defined. Yet at the top of the subroutine I have:
VB Code:
Dim myConnectionInfo As ConnectionInfo Dim myConnectionInfo2 As ConnectionInfo Dim ReportPath As String Dim mySelectionFormula As String = "" myConnectionInfo = New ConnectionInfo With myConnectionInfo .ServerName = "Primero" .DatabaseName = "Tooling" .UserID = "sa" .Password = myPasswordTechniSQL End With With myConnectionInfo2 .ServerName = "Primero" .DatabaseName = "Techni" .UserID = "sa" .Password = myPasswordTechniSQL End With




Reply With Quote