Ciao A tutti . Ho il seguente problema.
Ho un applicativo che con Crystal Report 8.5 crea delle anteprime di stampa (utilizzo Db Access 2000)
Sul mio computer Win 2000 Professional funziona tutto bene ,mentre su altri pc con win 98 e win 2000 quando creo la seconda anteprima di stampa, consecutiva alla prima , mi genera il seguente errore :
The instruction at 0x0b99e024 referenced memory at 0x0b99e024 .The memory could not be read
Click on ok to terminate the program .
Click on cancel to debug the program.
e si inchioda .Ho gia' controllato se metto le variabili a nothing quando esco dalla prima anteprima e infatti era ok questa cosa..
Altra cosa ho aggiornato con l'ultima sp4 un computer che dava questo errore e non e' mutato nulla .
Premetto che se invece di fare l'anteprima , stampo direttamente , il problema non sussiste.Vi ringrazio.
ecco la parte di codice "incriminata "
'parte per richiamare la form per l'anteprima di stampa da un'altra form
Rep_Nome = "PROSPET1.RPT"
Set NewStm = New frmPreview
NewStm.Show vbModal
'form contenente l'anteprima di stampa
Private rdApp As CRAXDRT.Application
Private crRpt As CRAXDRT.Report
Private Sub Form_Load()
Dim rptTable As CRAXDRT.DatabaseTable
Dim rptSect As CRAXDRT.Section
Dim rptSubReport As CRAXDRT.SubreportObject
Dim crSubRpt As CRAXDRT.Report
Dim rptObject As Object
Dim rptParamDef As CRAXDRT.ParameterFieldDefinitions
Dim rptParam As CRAXDRT.ParameterFieldDefinition
Dim rptFormulaDef As CRAXDRT.FormulaFieldDefinitions
Dim rptFormula As CRAXDRT.FormulaFieldDefinition
Dim StrNomeCampo(10) As String
Dim StrNomeTabella(10) As String
'ordinamento
Dim crField As CRAXDRT.DatabaseFieldDefinition
Dim ContaTabella, ContaCampo
Dim I_Contatore As Integer
Dim i As Integer
Dim Var As String
Dim CountFormula As Byte
CountFormula = 0
If Rep_Nome = "" Then Exit Sub
If Trim$(PERCORSORPT) <> "" Then
Set rdApp = CreateObject("CrystalRuntime.Application.8.5")
Set crRpt = rdApp.OpenReport(Trim$(PERCORSORPT) & Rep_Nome)
crRpt.Database.SetDataSource DBSFERA
For Each rptTable In crRpt.Database.Tables
rptTable.Location = PERCORSODB & "sfera.mdb"
If Password <> "" Then
rptTable.SetSessionInfo "", Chr(10) & Password
End If
Next rptTable
For Each rptSect In crRpt.Sections
For Each rptObject In rptSect.ReportObjects
If rptObject.Kind = crSubreportObject Then
Set rptSubReport = rptObject
Set crSubRpt = rptSubReport.OpenSubreport
For Each rptTable In crSubRpt.Database.Tables
rptTable.Location = PERCORSODB & "sfera.mdb"
If Password <> "" Then
rptTable.SetSessionInfo "", Chr(10) & Password
End If
Next rptTable
Set rptSubReport = Nothing
End If
Next rptObject
Next rptSect
If frmPrintSelez.optionStampa.Value = True Then
Screen.MousePointer = vbDefault
crRpt.PrintOut
Me.Show
Unload Me
Else
CRViewer1.ReportSource = crRpt
CRViewer1.ViewReport
Screen.MousePointer = vbDefault
End If
End If
End If
End Sub
Private Sub Form_Resize()
On Error Resume Next
CRViewer1.Move 75, 75, Me.ScaleWidth - 150, Me.ScaleHeight - 150
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim StrAzi As Recordset
Dim StrRepTop As Recordset
Set crRpt = Nothing
Set rdApp = Nothing
Set frmPreview = Nothing 'nome del form
Rep_Sel = ""
Rep_Nome = ""
End Sub
Ciao ,grazie Luca Martini