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

Why out of memory?

Status
Not open for further replies.

1forino

Programmer
Apr 26, 2001
14
PT
Hi,

I am making an application in VB6 with SQL SERVER and reports in Crystal Reports 8.0
When I modify some information in database and want to call new report to visualize the information, occurs error OUT OF MEMORY, why?
Is necessary to filter the information for months.
Already I worked with Crystal and VB 6, but it is the first time that I call reports from a database in SQL SERVER.
One of the problems with that I come across myself is that report always does not make refresh that is acceded. How to make autorefresh always that report is called?
Thanks, for any tip.

This is the code that I am to use:

Dim CrystalApp As CRAXDRT.Application
Dim CrystalReport As CRAXDRT.Report
Dim CrystalTable As CRAXDRT.DatabaseTable

Private Sub Form_Load()

On Error GoTo Erro

Dim intMes As Integer

Set CrystalApp = CreateObject("CrystalRuntime.application")

Set CrystalReport = CrystalApp.OpenReport(App.Path & "\rptOrdemPagamento.rpt")

For Each CrystalTable In CrystalReport.Database.Tables
CrystalTable.SetLogOnInfo "box.link.pt", "gap", "gap", "siggap"
Next

intMes = Month(Date)

CrystalReport.RecordSelectionFormula = "{Despesas_Empregado.Mes} =" & intMes & ""

'Atribuição ao CRViewer a source do Report
CRViewer1.ReportSource = CrystalReport

'Mostra Report
CRViewer1.ViewReport

Exit Sub
Erro:
MsgBox Err.Description


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top