0

i have a crystal report then i create new connection under Access/Excel, then i select my database.
i add 2 access database say Database1.tbl_employee and Database2.tbl_images.
now i linked the 2 tables from 2 database.
tbl_employee.ID ---- tbl_images.ID

it works well on crystal report the problem is when i call the report from vb its asking for a connection info,
currently i have this code.

but i only declare 1 database connection info on this code.
is there a way to have them both ,, i mean connection info for 2 database.
any help would do.

1
Contributor
1
Reply
14
Views
4 Years
Discussion Span
Last Post by shann_
0
 Dim tbCurrent As CrystalDecisions.CrystalReports.Engine.Table
        Dim tliCurrent As CrystalDecisions.Shared.TableLogOnInfo

            Dim cryRpt As New ReportDocument
            cryRpt.Load(Application.StartupPath & "\Reports\cr_client_form.rpt")

For Each tbCurrent In cryRpt.Database.Tables
                tliCurrent = tbCurrent.LogOnInfo
                With tliCurrent.ConnectionInfo
                    .ServerName = Application.StartupPath & "\DataImg.mdb"
                    .UserID = ""
                    .Password = "ian"
                    .DatabaseName = Application.StartupPath & "\DataImg.mdb"
                End With
                tbCurrent.ApplyLogOnInfo(tliCurrent)
            Next tbCurrent


            CrystalReportViewer1.ReportSource = cryRpt
            CrystalReportViewer1.Refresh()
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.