Error while getting Recordset from component in ASP

Discussion in 'ASP General' started by Sudhakar Sankar, Oct 31, 2003.

  1. Hi all,

    I am using a COM+ component to fetch the Recordset from the database.
    My coding is as follows:

    ' ------ In COM+ Application --------------
    Function executeResultQuery(Con as Connection, qry as String) As
    Object
    dim oRs as New ADODB.Recordset
    oRs.open qry, con
    Set executeResultQuery = oRs
    End Function

    '------- In ASP Page

    <%
    Set obj=Server.CreateObject("myProj.MyClass")
    Set con=Server.CreateObject("ADODB.Connection")
    con.open "mydsn","",""
    sql = "select * from students"
    Set rs = obj.executeResultQuery(con,sql) <--- Error raised here
    While not rs.eof
    response.write(rs(0))
    rs.movenext
    Wend
    %>

    At the time of processing the ASP page, i am getting the following
    error:

    Microsoft VBScript runtime (0x800A000D)
    Type mismatch: 'executeResultQuery'
    /remote/sample1.asp, line 16

    What is the problem here?

    I changed in COM+ application as "Recordset" from "Object" for the
    return type. No luck.

    Advise appreciated.

    Thanks & regards,

    S.Sudhakar Sankar.
     
    Sudhakar Sankar, Oct 31, 2003
    #1
    1. Advertising

  2. Sudhakar Sankar

    Bob Barrows Guest

    Sudhakar Sankar wrote:
    > Hi all,
    >
    > I am using a COM+ component to fetch the Recordset from the database.
    > My coding is as follows:
    >
    > ' ------ In COM+ Application --------------
    > Function executeResultQuery(Con as Connection, qry as String) As
    > Object
    > dim oRs as New ADODB.Recordset
    > oRs.open qry, con
    > Set executeResultQuery = oRs
    > End Function
    >
    > '------- In ASP Page
    >
    > <%
    > Set obj=Server.CreateObject("myProj.MyClass")
    > Set con=Server.CreateObject("ADODB.Connection")
    > con.open "mydsn","",""
    > sql = "select * from students"
    > Set rs = obj.executeResultQuery(con,sql) <--- Error raised here
    > While not rs.eof
    > response.write(rs(0))
    > rs.movenext
    > Wend
    > %>
    >
    > At the time of processing the ASP page, i am getting the following
    > error:
    >
    > Microsoft VBScript runtime (0x800A000D)
    > Type mismatch: 'executeResultQuery'
    > /remote/sample1.asp, line 16
    >
    > What is the problem here?
    >
    > I changed in COM+ application as "Recordset" from "Object" for the
    > return type. No luck.
    >
    > Advise appreciated.
    >
    > Thanks & regards,
    >
    > S.Sudhakar Sankar.


    http://support.microsoft.com?kbid=197956
    http://support.microsoft.com?kbid=243548
    http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=OGR8dX8J$GA.150@cppssbbsa04
    http://tinyurl.com/t4zi

    HTH,
    Bob Barrows


    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows, Oct 31, 2003
    #2
    1. Advertising

  3. Sudhakar Sankar

    Mark Schupp Guest

    Try:

    Function executeResultQuery(ByRef Con, ByVal qry)
    Set executeResultQuery = Con.Execute(qry)
    End Function

    Or better, just put the con.execute statement inline in the asp script.

    --
    Mark Schupp
    Head of Development
    Integrity eLearning
    www.ielearning.com


    "Sudhakar Sankar" <> wrote in message
    news:...
    > Hi all,
    >
    > I am using a COM+ component to fetch the Recordset from the database.
    > My coding is as follows:
    >
    > ' ------ In COM+ Application --------------
    > Function executeResultQuery(Con as Connection, qry as String) As
    > Object
    > dim oRs as New ADODB.Recordset
    > oRs.open qry, con
    > Set executeResultQuery = oRs
    > End Function
    >
    > '------- In ASP Page
    >
    > <%
    > Set obj=Server.CreateObject("myProj.MyClass")
    > Set con=Server.CreateObject("ADODB.Connection")
    > con.open "mydsn","",""
    > sql = "select * from students"
    > Set rs = obj.executeResultQuery(con,sql) <--- Error raised here
    > While not rs.eof
    > response.write(rs(0))
    > rs.movenext
    > Wend
    > %>
    >
    > At the time of processing the ASP page, i am getting the following
    > error:
    >
    > Microsoft VBScript runtime (0x800A000D)
    > Type mismatch: 'executeResultQuery'
    > /remote/sample1.asp, line 16
    >
    > What is the problem here?
    >
    > I changed in COM+ application as "Recordset" from "Object" for the
    > return type. No luck.
    >
    > Advise appreciated.
    >
    > Thanks & regards,
    >
    > S.Sudhakar Sankar.
     
    Mark Schupp, Oct 31, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ^CrazyCoder^
    Replies:
    3
    Views:
    7,270
    Terrence Benade
    Sep 15, 2003
  2. nicholas
    Replies:
    3
    Views:
    850
    nicholas
    Oct 4, 2004
  3. Hung Huynh
    Replies:
    8
    Views:
    314
    Bob Barrows
    Sep 24, 2003
  4. Miguel Minora
    Replies:
    1
    Views:
    152
    Miguel Minora
    Jan 11, 2005
  5. George
    Replies:
    4
    Views:
    610
    Roedy Green
    Jun 28, 2012
Loading...

Share This Page