Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crystal Report Error 14 74
Crystal Reports - Display Last Invoice in Group 15 65
The remaining text does not appear to be part of the formula error 2 29
Crystal Report detail 15 38
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 …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

24 Experts available now in Live!

Get 1:1 Help Now