By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,963 Members | 1,279 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,963 IT Pros & Developers. It's quick & easy.

Error while getting Recordset from component in ASP

P: n/a
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.
Jul 19 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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=e...%40cppssbbsa04
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"
Jul 19 '05 #2

P: n/a
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" <su************@yahoo.com> wrote in message
news:44*************************@posting.google.co m...
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.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.