Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Error 20534 when running Crystal Reports from a VB 4.0 program

Posted on 1997-10-30
1
Medium Priority
?
227 Views
Last Modified: 2006-11-17
I am developing in MS VB 4.0 under MS DOS 6.22 & MS Windows 3.1.1.My application calls 5 Crystal Reports which run over an MS Access database with no problem. These reports do not have any selection criteria - they provide summary information over the whole of the tables they refer to. However, I have two other reports which do have selection criteria, set within the VB code. The application runs OK on the development PC, but when I use the VB Setup Wizard to produce a set of installation disks and install the application on a user's PC, running these two reports gives the above error.

Please find attached the VB code which calls the CRs.

**********************************************************
Public Sub ReportHandler(report As Integer)
**********************************************************
Dim dummy As String

    Select Case report
        Case 1
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\opnclms.rpt"
        Case 2
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\sixweek.rpt"
        Case 3
             frmMDI_Insurance.CrystalReport1.ReportFileName = ".\depttype.rpt"
        Case 4
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\reserved.rpt"
        Case 5
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\settle.rpt"
        Case 6  {one case which gives the error}
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\Crawlet.rpt"
            dummy = Chr(39) + grsClaimDetails("RBC_REF") + Chr(39)
            frmMDI_Insurance.CrystalReport1.SelectionFormula = "{qryMailMerge.RBC_REF}=" + dummy
        Case 7 {the second case which gives the error}
            frmMDI_Insurance.CrystalReport1.ReportFileName = ".\Claimlet.rpt"
           ' Call LogFile("After setting the reportname to Claimlet")
            dummy = Chr(39) + grsClaimDetails("RBC_REF") + Chr(39)
          '  Call LogFile("After building Dummy")
            frmMDI_Insurance.CrystalReport1.SelectionFormula = "{qryMailMerge.RBC_REF}=" + dummy
           ' Call LogFile("After setting the report selection formula")
    End Select
   
    frmMDI_Insurance.CrystalReport1.Destination = 0
 '   Call LogFile("After setting the report destination")
    frmMDI_Insurance.CrystalReport1.Action = 1
{the following line is not executed -> the error occurs on the Action of the report}
 '   Call LogFile("After setting the report Action")
   
End Sub

Any ideas ? Anything I can check/am (not) doing ?

Regards,

Simon Hall, Redditch Borough Council, Worcestershire, UK.
0
Comment
Question by:gog
[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
1 Comment
 

Accepted Solution

by:
thomaskramer earned 400 total points
ID: 1439232
I think you have to re-set the DataFiles property of the crystal report control in your code, because it is stored in the report. When opening the report from vb, crystal report searches the database in the old directory. So write something like this:

CrystalReport1.DataFiles(0) = "c:\new\first.mdb"


0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

688 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