Skip to Content
0
Former Member
Aug 29, 2016 at 06:46 PM

Unable to Set DataSouce Connection Information on Report with Sub Reports After updating to 13.0.17

445 Views

We are currently using 13.0.4, in the process of updating to 13.0.17 we noticed that any time that we run a report with subreports, Crystal would prompt for the database password. After further investigation, I noticed that if the report has any subreports the SetConnection Overload that takes in the user name and password would not actually update the connection object. Below i have posted the code that is being used.

Dim CR As new CrystalDecisions.CrystalReports.Engine.ReportDocument

CR.DataSourceConnections(0).SetConnection(dataPath & "test.mdb", dataPath & "test.mdb", "Admin", "<password>")

For i As Integer = 0 To CR.Subreports.Count - 1

CR.Subreports(i).DataSourceConnections(0).SetConnection(dataPath & "test.mdb", dataPath & "test.mdb", "Admin", "<password>")

Next