Results 1 to 2 of 2

Thread: easy little .dll giving error

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    May 2000
    Posts
    142
    Hi.

    I need to do some report generation from ASP, but to do so, must first set up a .dll to manage things.

    Here is the VB code of the ReportServer class of my Reporting dll:
    (btw: I am using ActiveReports)

    Code:
    Function RunReport(rs As Recordset) As Integer
    On Error Resume Next
        Dim ar As ActiveReport1
        Set ar = New ActiveReport1
        
        ar.DataControl1.Recordset = rs
        ar.DataControl1.Refresh
        ar.Run
        
        RunReport = Err.Number
    End Function
    Then I call this in ASP:

    Code:
    <%
    set oRS = Server.CreateObject("ADODB.recordset")
    stmSQL = "SELECT * FROM table1"
    oRS.open stmSQL,"DSN=data1"
    
    Set rptSrv = CreateObject("Reporting.ReportServer")
    Response.Write "Error Code: "&rptSrv.RunReport(oRS)
    %>
    Produces the following error:

    --
    Microsoft VBScript runtime error '800a000d'
    Type mismatch: 'rptSrv.RunReport'
    --

    What am I missing?

    tx
    /~dvst8/

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    Since, in ASP all variables are Variants, change your DLL's RunReport function to have rs as variant. This should fix it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width