Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crystal, Informix, & VB6

Status
Not open for further replies.

AndyWalker

IS-IT--Management
Feb 3, 2003
1
GB
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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top