Darold
Apr 3rd, 2006, 04:19 PM
My VB program will sometimes lockup while populating the report with the disconnected recordset. This occurs while in VB studio and can also occur with the compiled version on another machine.
I am using VB6 on Windows XP service Pack 2 with crystal report professional 10.
The report was created with a data definition file (.ttx)
The VB program has the control CrystalActiveXReportViewer on frmForm. The Control is named CrystalActiveXReportView1.
rsFinal is a disconnected adodb.recordset.
---- Code 1 -----
Public crxApplication As CRAXDRT.Application
Public crxReport As CRAXDRT.Report
---- Code 2 -----
strReportName = App.Path & "\Test.rpt"
Set crxReport = crxApplication.OpenReport(strReportName, 1)
crxReport.Database.Tables.Item(1).SetDataSource rsFinal, 3
frmform.CrystalActiveXReportViewer1.ReportSource = crxReport1
frmform.CrystalActiveXReportViewer1.ViewReport
frmform.show
---- Code 3 ----
set crxApplication = nothing
set crxReport = nothing
unload form
--- end of Code ----
I do not understand why sometimes it works and sometimes is does not. The lockup causes me to have to kill VB through task manager. Staring VB for the first time, the report usually displays, but some point the report stops working and locks up VB.
I think something is not unloading, but maybe not?
I am using VB6 on Windows XP service Pack 2 with crystal report professional 10.
The report was created with a data definition file (.ttx)
The VB program has the control CrystalActiveXReportViewer on frmForm. The Control is named CrystalActiveXReportView1.
rsFinal is a disconnected adodb.recordset.
---- Code 1 -----
Public crxApplication As CRAXDRT.Application
Public crxReport As CRAXDRT.Report
---- Code 2 -----
strReportName = App.Path & "\Test.rpt"
Set crxReport = crxApplication.OpenReport(strReportName, 1)
crxReport.Database.Tables.Item(1).SetDataSource rsFinal, 3
frmform.CrystalActiveXReportViewer1.ReportSource = crxReport1
frmform.CrystalActiveXReportViewer1.ViewReport
frmform.show
---- Code 3 ----
set crxApplication = nothing
set crxReport = nothing
unload form
--- end of Code ----
I do not understand why sometimes it works and sometimes is does not. The lockup causes me to have to kill VB through task manager. Staring VB for the first time, the report usually displays, but some point the report stops working and locks up VB.
I think something is not unloading, but maybe not?