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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB causing memory error when a Crystal Report opened

Status
Not open for further replies.

petherin

Programmer
Dec 3, 2002
13
0
0
GB
I have a VB program which uses Crystal Reports 8.5 ActiveX Designer Design and Runtime Library (craxddrt.dll). I want to open a report using the CRAXDDRT.Application object, but a Windows system error is occurring when the OpenReport method of the CRAXDDRT.Application object is used.

First, a CRAXDDRT.Report object is created. Then a CRAXDDRT.Application is created, and its OpenReport method is used to open a report which resides on the local hard drive. The path to the report has been verified as correct, but a Windows system error is still created. The error says 'The program has encountered a problem and needs to close.'

Sometimes a different error is generated:

VB6.EXE - Application Error
The instruction at "0x0fa9183f" referenced memory at "0x00000000". The memory could not be "read".
Click on OK to terminate the program

Code summary:

CODE
Dim objCrystalReport As New CRAXDDRT.Report

Then the following function is called:


CODE
Private Function SetupParameters(objCrystalReport As CRAXDDRT.Report) As Boolean

Dim objCrystalApp As CRAXDDRT.Application

Set objCrystalApp = New CRAXDDRT.Application
Set objCrystalReport = objCrystalApp.OpenReport(sReportPath & sReportName) 'The error occurs when this line is executed

System: Windows XP SP 1
Crystal Reports 8.5.3.975 (SP3 has been applied)
VB6 SP5

Strangely, other reports are opened fine, but others aren't, and there's no discernible difference between them. Can someone tell me what's going on?
 
This is a known issue in V9 but I don't know whether this is the case for 8.5.

An ActiveX DLL, containing a form and viewer, references the Crystal Reports ActiveX Designer Design and Runtime library (Craxddrt.dll).

When previewing a report for the second time using the ActiveX DLL, the following error message appears:

"Out of memory"

Why does this error message appear?


Solution

This is a known issue when using an ActiveX DLL that references Craxddrt.dll. This issue has been tracked and assigned Track ID ADAPT00258166.

If the ActiveX DLL references the Crystal Report ActiveX Designer Runtime library (Craxdrt.dll), the report previews successfully.

To work around this issue, load Craxdrt.dll in memory. For example:

Private Sub Form_Load()
Dim tempcrxApp As CRAXDRT.Application
Set tempcrxApp = CreateObject("CrystalRuntime.Application.9")
End Sub

====================
NOTE:

Craxddrt.dll is required when using the Embeddable Crystal Reports Designer Control (Crdesignerctrl.dll). If you are not using this control, change any Craxddrt.dll references to Craxdrt.dll.
====================

Gary Parker
MIS Data Analyst
Manchester, England
 
I am getting memory error msg when exiting a VB6 app w/ Crystal V9.2 after one query, but app exits OK w/ multiple queries. I am unloading all forms, setting CRAXDRT.Application & CRAXDRT.Report to "nothing".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top