Solved

VB6.exe application error (CRAXDRT.DLL) when viewing a Crystal Reports in VB6

Posted on 2004-09-03
4
3,143 Views
Last Modified: 2011-11-06
I use the following code to open and view the report (I use a CRViewer control on a form and the code is executing on
Form_Load event):

Private Sub Form_Load()

Dim crystal As CRAXDRT.Application
Dim crxBookingsOpeningsReport As CRAXDRT.Report

    Set crystal = New CRAXDRT.Application
    Set crxBookingOpeningsReport = New CRAXDRT.Report
   
        Set crxBookingsOpeningsReport = crystal.OpenReport(App.Path & "\Reports\TheatricalBookingsOpeningsGroupByCircuit.rpt")
         
    With crxBookingsOpeningsReport
        .ParameterFields.Item(1).ClearCurrentValueAndRange
        .EnableParameterPrompting = False
        .ParameterFields.Item(1).AddCurrentValue (Date)
    End With

    crxBookingsOpeningsReport.Database.Tables.Item(1).SetLogOnInfo strServerName, strDatabaseName, strUsername, strPassword
     
     Me.Left = 300
     Me.Top = 300
     Me.Width = Screen.Width - 500
     Me.Height = Screen.Height - 900

     crvBookingsOpenings.Width = Me.Width - 500
     crvBookingsOpenings.Height = Me.Height - 700
     crvBookingsOpenings.ReportSource = crxBookingsOpeningsReport
     crvBookingsOpenings.ViewReport
     crvBookingsOpenings.Zoom 120

End Sub

My report data source is a stored procedure in MS SQL Server 2000 which takes one parameter of datetime type.
The report is correctly displayed and printed in Crystal Reports. I use Crystal Reports 8.0 and VB6 (with SP6 installed)

When I open the form, I get the error:

VB6.exe application error
The instruction at "0x42e38840" referenced memory at "0x00000044". The memory could not be "read".
Click on OK to terminate the program
Click on Cancel to debug the program

If I click on Cancel button, VC++6.0 openes and I get the message:

Unhandled exception in VB6.exe(CRAXDRT.DLL): 0xC0000005: Access Violation.

Can somebody help me please ? I need an answer really fast


     
0
Comment
Question by:mihainitu
4 Comments
 
LVL 13

Accepted Solution

by:
vidru earned 250 total points
ID: 11977357
Try replacing your first 5 lines with these 3:

Dim crystal As New CRAXDRT.Application
Dim crxBookingsOpeningsReport As CRAXDRT.Report

    Set crxBookingsOpeningsReport = crystal.OpenReport(App.Path & "\Reports\TheatricalBookingsOpeningsGroupByCircuit.rpt")

-dave
0
 
LVL 13

Assisted Solution

by:EwaldL
EwaldL earned 250 total points
ID: 11977690
can you test if the code works with a stored proc that does not take parameters?

if that's the problem, then i would assume the date variable is the problem. does it work when hardcoding the value?
ie: crxBookingsOpeningsReport.ParameterFields(1).AddCurrentValue CDate("3/3/1995 12:00:00 AM")
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question