I am developing in VB 6.0 with CR Version 9.
I have various SQL2000 databases with exactly the same structures.
Say I develop a report with Database1.
I then want to run that report using the same exact tables from Database2, Database3, etc.
Here is the code that was show to do it.
Dim crxtables As Object
Dim CPProperty As CRAXDRT.ConnectionProperty
Set MyReport = CrxApplication.OpenReport(ReportLocation)
Set crxtables = MyReport.Database.Tables
For Each Table In crxtables
Set CPProperty = Table.ConnectionProperties("Provider")
CPProperty.Value = "SQLOLEDB"
Set CPProperty = Table.ConnectionProperties("Data Source")
CPProperty.Value = "MYSQLSERVER"
Set CPProperty = Table.ConnectionProperties("Initial Catalog")
CPProperty.Value = "MYDB"
Set CPProperty = Table.ConnectionProperties("User ID")
CPProperty.Value = "USERNAME"
Next
MyReport.ViewReport
But, everytime I try to switch to a different database, the report only generates the information from the database it was created with.
Does anybody know a fix to this?
Thank you
I have various SQL2000 databases with exactly the same structures.
Say I develop a report with Database1.
I then want to run that report using the same exact tables from Database2, Database3, etc.
Here is the code that was show to do it.
Dim crxtables As Object
Dim CPProperty As CRAXDRT.ConnectionProperty
Set MyReport = CrxApplication.OpenReport(ReportLocation)
Set crxtables = MyReport.Database.Tables
For Each Table In crxtables
Set CPProperty = Table.ConnectionProperties("Provider")
CPProperty.Value = "SQLOLEDB"
Set CPProperty = Table.ConnectionProperties("Data Source")
CPProperty.Value = "MYSQLSERVER"
Set CPProperty = Table.ConnectionProperties("Initial Catalog")
CPProperty.Value = "MYDB"
Set CPProperty = Table.ConnectionProperties("User ID")
CPProperty.Value = "USERNAME"
Next
MyReport.ViewReport
But, everytime I try to switch to a different database, the report only generates the information from the database it was created with.
Does anybody know a fix to this?
Thank you