I am creating reports with VB6 and CR8 using RDC. These reports will be run at different locations with different database names. I have successfuly been able to change the database for the main report by using this code:
Const sDevDBName As String = "CSTS_Test_DB"
Dim sDBName As String ' Database name
Dim Report As New CrystalReport1 ' Crystal Report
Dim Table As Object
' Get the correct database name
sDBName = ReadINI("Database", "database", sINIFilePath)
'Set the correct database name
For Each Table In Report.Database.Tables
Table.Location = Replace(Table.Location, sDevDBName, sDBName)
Next
But now I have added a sub-report, I can't seem to access the database of the sub-report, any ideas?
Const sDevDBName As String = "CSTS_Test_DB"
Dim sDBName As String ' Database name
Dim Report As New CrystalReport1 ' Crystal Report
Dim Table As Object
' Get the correct database name
sDBName = ReadINI("Database", "database", sINIFilePath)
'Set the correct database name
For Each Table In Report.Database.Tables
Table.Location = Replace(Table.Location, sDevDBName, sDBName)
Next
But now I have added a sub-report, I can't seem to access the database of the sub-report, any ideas?