Using Sage 100 Premium 2017
Using Crystal Reports 2011
I have six production SQL databases, all structured identically (for regional purposes).
I have created a Crystal Report using a Connection based on OLEDB using one of the 6 databases. It uses integrated security, no data is saved with it, and it works fine.
I have registered Sage100ERP.Reporting DLL using REGASM.
I have a VBscript that creates the required object (Set report = CreateObject("Sage100ERP.Reporting.Report")) and I have a connection string set to the database
connectionString = "Provider=SQLOLEDB;Server=SQL2008;Trusted_Connection=yes;Database=Live1;"
the connection is set:
report.SetConnection connectionString
and the report generates in Preview:
report.Preview()
Using Cscript from c:\Windows\SysWoW64, I can run the VBS and all is good--it accesses the report and generates the Preview page.
NOW, I want to change the Connection string so that the tables in the report look to a different database, say Live2.
If I change the connection string per above, the report generates but uses the database that was set up in the report, not Live2.
Anyone have any idea how to dynamically pass the connection string to the report so that a different Database is used?