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!

"memory Full" 1

Status
Not open for further replies.

rogerluo

Programmer
Aug 13, 2001
21
0
0
GB
this is my code:

Private Sub Command1_Click()
Dim crxReport As CRAXDRT.Report
Dim crxApplication As New CRAXDRT.Application

Set crxApplication = CreateObject("CrystalRuntime.Application")
Set crxReport = crxApplication.OpenReport("H:\vb\CRVB\crystal.rpt")
crxReport.ParameterFields.Item(1).AddCurrentValue Text1.Text
CRViewer1.ReportSource = crxReport
CRViewer1.ViewReport
End Sub

however, only the first time i entered the parameter can work. when i change the parameter value, error message"memory full" will shown.

thanks a lot !
 
Private Sub Command1_Click()
Dim crxReport As CRAXDRT.Report
Dim crxApplication As New CRAXDRT.Application

Set crxApplication = CreateObject("CrystalRuntime.Application")
Set crxReport = crxApplication.OpenReport("H:\vb\CRVB\crystal.rpt")
crxReport.ParameterFields.Item(1).AddCurrentValue Text1.Text
CRViewer1.ReportSource = crxReport
CRViewer1.ViewReport
End Sub

You need to Set the crxApplication = Nothing, and the crxReport to nothing when your done with them (Just before the End Sub). Otherwise VB retains it in the memory causing you to get the "Memory Full" message. You should set all of your objects to nothing when you are done with them.

Good Luck,

Darrick
darrick3@yahoo.com
 
Hi Darrick,

Like Below?

Private Sub Command1_Click()
Dim crxReport As CRAXDRT.Report
Dim crxApplication As New CRAXDRT.Application

Set crxApplication = CreateObject("CrystalRuntime.Application")
Set crxReport = crxApplication.OpenReport("H:\vb\CRVB\crystal.rpt")
crxReport.ParameterFields.Item(1).AddCurrentValue Text1.Text
CRViewer1.ReportSource = crxReport
CRViewer1.ViewReport

Set crxApplication = Nothing
Set crxReport = Nothing
End Sub

However, still got the same message"Memory full".

thanks a lot!

danni
 
Are you using any other Set statements in your code that you are not releasing the memory?
 
I have an application that has several reports in it. They all work fine except one -- for which I get the "memory full" message. The only difference between this report and the others is that this one has a subreport in it. I have ensured that I've set all objects to 'nothing'.

Also all of my reports are passed a record set and use the TTX files.

Any ideas? Anyone?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top