Solved

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

Posted on 2004-09-03
4
3,185 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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…
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 …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

726 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