Solved

Run time error '7002'

Posted on 2002-07-08
5
485 Views
Last Modified: 2009-12-16
hi i'm using active report and the report is working properly unless i Make a dll of the Report Class and import it in the component service i started getting this error:
Run Time error '7002
'Application-defined or Object-defined error'.
Any Help ???
0
Comment
Question by:mirghani
  • 3
  • 2
5 Comments
 

Author Comment

by:mirghani
ID: 7137331
here is my Report Dll Code:
Option Explicit

Public Function GetReport(ByVal iReport As Integer) As Object
Dim rpt As Object

    On Error GoTo ehGetReport
    Select Case iReport
    Case 1:
        Set rpt = New TempTripsReport
    Case 2:
        Set rpt = New CandReport
    Case Else
        Set rpt = Nothing
    End Select
   
exGetReport:
    Set GetReport = rpt
    Exit Function
   
ehGetReport:
    Debug.Print Err.Description
    Set rpt = Nothing
    Resume exGetReport
End Function

the following is the .dsr in the same Dll
TempTripsReport
CandReport
and the following is the Client Code:

Dim MyCls As MyRep_Prj.MyClsReportManager
Set MyCls = New MyRep_Prj.MyClsReportManager
Dim MyRepObj As Object
Set MyRepObj = MyCls.GetReport(2)
Set frmarv.arv.ReportSource = MyRepObj
frmarv.Show 1
Set MyCls = Nothing
Set MyRepObj = Nothing
 then the '7002' error raise.
0
 

Expert Comment

by:VBMeera
ID: 7139656
hi,
would u plz tell me by debuging at what line it's giving error in ur above code?
0
 

Author Comment

by:mirghani
ID: 7151030
hi,
actually it's a dll so i can't recognize at which line the error occur and if i copy and paste the code in a Class in an EXE it works fine:-(
Regards.
0
 

Accepted Solution

by:
VBMeera earned 200 total points
ID: 7153375
hello,
if ur calling dll using New object try with CreateObject,
may it will solves ur problem.
Thnaks
0
 

Author Comment

by:mirghani
ID: 7343998
Sorry for Delay:-)
Meer.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

18 Experts available now in Live!

Get 1:1 Help Now