AndyWalker
IS-IT--Management
Hi guys I really need your help!!
We've developed a set of reports using Crystal 8.5, Informix IDS 9 for the DB and VB6 (SP5) for the front ends. We're using the Informix V3.34 32bit ODBC Drivers.
I need to make the reports switch databases to allow the user to see some archived data. The problem is that I can't make Crystal change to our Archive DB. VB Changes its DB connection like a charm, all I need to do is change the Database name in Connection String and connect. In crystal the reports still point at the database specified in the DSN. What's really mad is that this stuff all works fine with SQL Server
Here's the code that I'm using:
sDSN = "MyDSN"
sDataBaseName = "ARCHIVE"
sUID = "MyUser"
sPassword = "MyPassword"
oReport.Database.ConvertDatabaseDriver "p2sodbc.dll", True
oReport.Database.LogOnServer "PDSODBC.DLL", sDSN, sDataBaseName, sUID, sPassword
oReport.DiscardSavedData
' Set location for each table in the main report
For Each crxTable In oReport.Database.Tables
crxTable.SetLogOnInfo sDSN, sDataBaseName, sUID, sPassword
Debug.Print crxTable.Name & " " & crxTable.TestConnectivity
Next crxTable
' Set location for each table in any sub reports
For Each crxSection In oReport.Sections
Set crxReportObjects = crxSection.ReportObjects
For Each crxReportObject In crxReportObjects
If crxReportObject.Kind = 5 Then
Set crxSubReportObject = crxReportObject
Set crxSubReport = crxSubReportObject.OpenSubreport
For Each crxTable In oReport.Database.Tables
crxTable.SetLogOnInfo sDSN, sDataBaseName, sUID, sPassword
crxTable.Location = crxTable.Name
Next crxTable
End If
Next crxReportObject
Next crxSection
oReport.DiscardSavedData
oReport.Database.Verify
Any help would be VERY MUCH appreciated.
We've developed a set of reports using Crystal 8.5, Informix IDS 9 for the DB and VB6 (SP5) for the front ends. We're using the Informix V3.34 32bit ODBC Drivers.
I need to make the reports switch databases to allow the user to see some archived data. The problem is that I can't make Crystal change to our Archive DB. VB Changes its DB connection like a charm, all I need to do is change the Database name in Connection String and connect. In crystal the reports still point at the database specified in the DSN. What's really mad is that this stuff all works fine with SQL Server
Here's the code that I'm using:
sDSN = "MyDSN"
sDataBaseName = "ARCHIVE"
sUID = "MyUser"
sPassword = "MyPassword"
oReport.Database.ConvertDatabaseDriver "p2sodbc.dll", True
oReport.Database.LogOnServer "PDSODBC.DLL", sDSN, sDataBaseName, sUID, sPassword
oReport.DiscardSavedData
' Set location for each table in the main report
For Each crxTable In oReport.Database.Tables
crxTable.SetLogOnInfo sDSN, sDataBaseName, sUID, sPassword
Debug.Print crxTable.Name & " " & crxTable.TestConnectivity
Next crxTable
' Set location for each table in any sub reports
For Each crxSection In oReport.Sections
Set crxReportObjects = crxSection.ReportObjects
For Each crxReportObject In crxReportObjects
If crxReportObject.Kind = 5 Then
Set crxSubReportObject = crxReportObject
Set crxSubReport = crxSubReportObject.OpenSubreport
For Each crxTable In oReport.Database.Tables
crxTable.SetLogOnInfo sDSN, sDataBaseName, sUID, sPassword
crxTable.Location = crxTable.Name
Next crxTable
End If
Next crxReportObject
Next crxSection
oReport.DiscardSavedData
oReport.Database.Verify
Any help would be VERY MUCH appreciated.