I have a vb6 program that runs a Crystal Reports V9 .rpt via the RDC (crviewer). I load the form that contains the crviewer9; set parameters and run the report; I can rerun reports from this screen a bunch of times. In the dev environment (XP Pro), I can exit the form; reselect the form and once more view the reports. In the live enviroment (Windows 2000 Terminal), the program works fine the first time into the form. If I exit and re-enter the form (not exiting the VB progra) and try to run the report viewer again it looks like it will run (empty viewer comes up), but then after a pause it blows the session out of the water (no error -- just kills vb6 program).
If anybody can help me with this I would really appreciate it. Its making me look like an idiot around.
The code that runs the .rpt is below. The .rpt is connecting to an Sql Server 2000 and gathers data via a stored procedure.
---------------------------------------------------------------
Set crApp = New CRAXDDRT.Application
Set crReport = crApp.OpenReport(App.Path & "\" & wReportName)
Set crParams = crReport.ParameterFields
Set ConnectInfo = crReport.Database.Tables(1).ConnectionProperties
ConnectInfo.Item("Password") = "*****"
Set crParam = crParams.Item(1)
crParam.AddCurrentValue CDate(lblDate.Caption)
With CRViewer91
.Top = 0
.Width = fraReportViewer.Width
.Height = fraReportViewer.Height
.DisplayBorder = True
.EnableZoomControl = True
.DisplayGroupTree = False
.DisplayTabs = False
.EnableCloseButton = True
.ReportSource = crReport
.EnableExportButton = True
.ViewReport
'resets all CRAXDT properties
Set crTables = Nothing
Set crTable = Nothing
Set crParam = Nothing
Set crParams = Nothing
Set CRExport = Nothing
Set crFormulaFields = Nothing
Set crFormulaField = Nothing
Set crReport = Nothing
Set crApp = Nothing
A quick followup. I have done some testing on this problem and replaced the .rpt called with a totally simple .rpt. Just prints a text box. No parameters; no db connection. Still same problem exists...upon leaving the frame with the crviewer and then re-entering and running the report again, the program fails catastrophically -- bounces out to windows. But this only happens on the live environment -- runs fine in dev.