Solved

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

Posted on 2004-09-03
4
3,087 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now