Solved

Run time error '7002'

Posted on 2002-07-08
5
496 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

679 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