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!

CR9 in VB6 on Windows 98 OVERFLOW error

Status
Not open for further replies.

traceytr

Programmer
Mar 13, 2001
94
US
Greetings CR Gurus!
The following code works fine in our VB6 app with CR8.5 on all of our computers -- Windows XP, 2000, and 98. However, with our recent upgrade to CR9, we get an OVERFLOW error on the Windows 98 boxes. Upgrading from 98 isn't an option at this time, so we need to understand what is causing this error. Can anyone solve this mystery? We have spent many hours on this.

We call the report from a VB6 app with code pasted below. When we step through it, it blows up on the line:

CRViewer1.ViewReport

It's as if the CRViewer isn't right somehow with Windows 98.
The error is a Microsoft Visual Basic message box that reads:

Runtime error 6: Overflow

Our code:

'We set the Crystal objects
Set CRReport = Nothing
Set CRReport = New CRAXDRT.Report
Set CrxApp = Nothing
Set CrxApp = CreateObject("crystalruntime.application.9")
Set CRXSubReport = Nothing
Set CRXSubReport = New CRAXDRT.Report
Set CRXSubReport2 = Nothing
Set CRXSubReport2 = New CRAXDRT.Report

'Next we run the stored procedure
(Didn't paste all of the code for that...)

'Then we set and pass the parameters to Crystal
(Didn't paste all of the code for that...)

Set CRReport = CrxApp.OpenReport(gReport_Location & gstrReport & ".rpt")
Set CRXParamDefs = CRReport.ParameterFields
For Each CRXParamdef In CRXParamDefs
With CRXParamdef
Select Case .ParameterFieldName
Case "SEASON_YEAR"
.SetCurrentValue Left(cboSeason.Text, 7)
Case "CCN"
.SetCurrentValue Left(cboCCN.Text, 3)
Case "FASHION_LABEL"
.SetCurrentValue Left(cboLabel.Text, 4)
Case "SESSION"
.SetCurrentValue iCurrentSession
Case "Division_Name"
.SetCurrentValue "92"
Case "REPORT_FOOT"
.SetCurrentValue sReport_Foot
End Select
End With
Next

'Next we set the location

Dim CRconn As CRAXDRT.ConnectionProperties
Set CRconn = CRReport.Database.Tabl(1).ConnectionProperties

CRReport.Database.Tables(1).DllName = "crdb_ado.dll"
CRconn.DeleteAll
CRconn.Add "Provider", "SQLOLEDB"
CRconn.Add "Data Source", gSqlServer
CRconn.Add "Initial Catalog", "OurAppName"
CRconn.Add "User ID", "OurAppName"
CRconn.Add "Password", "OurPassword"

'Lastly, we load and show the form that has the CR Viewer

Load frmViewReport '(see the form load code below)
frmViewReport.Show

'This is the form_load code for frmViewReport.
Me.Height = 7800
Me.Width = 11930
Me.Top = 0
Me.Left = 0
CRViewer1.Height = 7510
CRViewer1.Width = 11940
CRViewer1.ReportSource = CRReport
CRViewer1.DisplayGroupTree = False
CRViewer1.EnableExportButton = True
CRViewer1.EnableCloseButton = True
If bPreview = True Then
CRViewer1.ViewReport 'BLOWS UP ON THIS LINE
DoEvents
Else
If bPopUpPrinterBox = False Then
CRReport.PrintOut True, 1, True
Else
CRReport.PrintOut False
End If
DoEvents
End If

This is a hair puller. Thanks.


Tracey



 
I forgot to mention these same 98 machines generate the report fine in Crystal design mode. It's only from the VB6 app that we get the error.

Tracey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top