Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

runtime error 91 on Windows 98 machine 1

Status
Not open for further replies.

bomburmusicmallet

Programmer
Nov 7, 2003
9
US
Hi all,

I'm new to using Crystal Reports, and don't have any reference materials except the internet and some code that was handed off to me.

I have a small vb app that can show a Crystal Report. It works fine on my computer (Windows XP Pro) and an NT computer at the end-user's office. However, on their Windows 98 machines, as soon as the report object is called, they get an error "Runtime error 91, Object variable not set or with block variable not set"

In my installation package, I included cpeaut32.dll in the Windows\System32 folder.

Any ideas? Thanks.
 
Chances are there is a dll issue going on here. What type of OS was the vb app built on? Was the installation routine built to take into account differences in dll files? WinXP and NT often use Unicode compliant dll's, whereas Win 98 does not (and will have problems if a Unicode version of a dll is installed on it).

A little more clarification would also be helpful. Are you getting the error when you are declaring the Report object in code, as in:

Dim crystalApplication As CRPEAuto.Application
Dim CRWReport As CRPEAuto.Report

Or when you are trying to view/print the report (as in CRWReport.Preview or CRWReport.PrintOut).
 
Thank you so much for replying! I hope you can help me get this straightened out.

The app was built on my machine, Windows XP Pro. I am not sure how to build an installation routine that would take into account any differences of dll files. I am using Wise, and am under the impression that it will not install an older dll file. The Windows 98 machine supposedly has this dll file, but I don't know in what directory. It's at a customer's site, and my boss doesn't get out there very often. However, I'm fairly certain they are using Crystal Reports v7.

The actual error occurs the first time the report object is called. In my main form, I declare the report object:

Code:
Public oReports As New CrReports

This gets called when the user presses the reports button:

Code:
frmMain.oReports.ReportClick frmMain.APP_MODE

I have a debugging statement before that:

Code:
frmMain.LOG_FILE.WriteLine "Going to initialize class CrReports"

and it is the last thing in the debug file before the runtime error.

Here's a little bit from my reports class:

Code:
Dim Application As CRPEAuto.Application
Dim Report As CRPEAuto.Report
Dim View1 As CRPEAuto.View
Public WithEvents Window1 As CRPEAuto.Window

Public Sub ReportClick(inMode)
    If inMode = 1 Then ' RMA
        ShowReport "RMA.rpt", inMode
    ElseIf inMode = 2 Then ' Non-MDSE
        ShowReport "Credit.rpt", inMode
    ElseIf inMode = 3 Then ' Feedback
        ShowReport "Feedback.rpt", inMode
    End If
End Sub

Private Sub Class_Initialize()
    'Assign application object
    Set Application = CreateObject("Crystal.CRPE.Application")
frmMain.LOG_FILE.WriteLine "Initialized Class CrReports"
End Sub

The debugging line "Initialized Class CrReports" never shows up in the debug file.

I hope I have answered all of your questions. Does this make sense? Something else that's nagging me is the version of Crystal. I believe that CRPE is for v7 (is that right?) and that corresponds to the cpeaut32.dll file. I have included in my references craxdrt.dll, which is 8.5 ActiveX Designer Runtime Library. However, I don't believe it's used (I can remove it and never get a runtime or compilation error) and from what I've read elsewhere, that's "CrystalRuntime.Application" which I'm not creating. The reports were created with v8. I really don't know if any of this is relevant.

Thanks a bunch!
 
Well, you will have problems with the Automation Server (cpeaut32.dll) trying to run CR 8 files, unless they've been saved down (using Save As) to the CR 7 version. And you're right about not needing CRAXDRT.DLL. That is the Runtime Designer Component (RDC) and your app is not using it. And, just as an aside, your app is using what is now (in CR 9) a depricated approach to deploying reports; the Automation Server is no longer supported.

But, since you can run the app on your development box but not on the client box, the problem must lie in your deployment. For an Automation Server app, you should make sure you are deploying the following dll's:

CPEAUT32.DLL
CRPE32.DLL
CRPAIG80.DLL
IMPLODE.DLL
MFC42.DLL
MSVCIRT.DLL
MSVCP60.DLL
MSVCRT.DLL

That's not an exhaustive list, but it's a starting point. You should be able to create your report object with those dll's installed. Further, CPEAUT32.dll should self-register. I'm not sure about the rest (my working install of an old Automation Server app I did is not available to me at the moment).

It's extremely valuable to have a test box that models the client's environment as much a possible. I use multiple boots on my systems in my office so I can test installs on Win 98, Win2K, and XP. You really should have that capability in your office. But that's just my opinion.
 
Thank you so much for your help. I am able to locate other information based on your information. I'm wondering if it would be worth upgrading my VB app to use Crystal Reports v8; plus, I've noticed that Wise Installer only has merge modules for v8.5.

Thanks again! I'll be rebuilding my installation project and testing again in a couple of weeks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top