jmreynolds
Programmer
My coworker and I have been trying to work with a Crystal 9 Report in VBA \ VB6. We need to set the database location programmatically.
We are using the following code:
but instead of setting the location, it is deleting all of the tables, such that oRpt.Database.Tables is empty.
Any ideas what is going on here?
We are using the following code:
Code:
For Each oSection In oSections
For Each oRptObj In oSection.ReportObjects
If oRptObj.Kind = crSubreportObject Then
Set oSubReportObject = oRptObj
Set oSubReport = oSubReportObject.OpenSubreport
For Each tbl In oSubReport.Database.Tables
tbl.Location = mdbPath
Next
Set oSubReport = Nothing
End If
Next
Next
For Each tbl In oRpt.Database.Tables
tbl.Location = mdbPath
Next
Any ideas what is going on here?