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
Solved

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

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 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