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" <sudhakarsankar@yahoo.com> wrote in message
news:44060d0.0310310251.24fd9fa7@posting.google.co m...[color=blue]
> 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.[/color]