Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Error while getting Recordset from component in ASP

Reply
Thread Tools

Error while getting Recordset from component in ASP

 
 
Sudhakar Sankar
Guest
Posts: n/a
 
      10-31-2003
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.
 
Reply With Quote
 
 
 
 
Bob Barrows
Guest
Posts: n/a
 
      10-31-2003
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"


 
Reply With Quote
 
 
 
 
Mark Schupp
Guest
Posts: n/a
 
      10-31-2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) 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.



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting error while getting Google plus posts George Java 4 06-28-2012 07:53 PM
Is there any POP3 and NNTP component I can use as a ASP Component? Miguel Minora ASP General 1 01-11-2005 10:16 PM
asp.NET dll-component: server security hole ?? (managed component) nicholas ASP .Net 3 10-04-2004 11:44 AM
RecordSet.Move or RecordSet.AbsolutePosition?? Hung Huynh ASP General 8 09-24-2003 11:07 AM
Got error msg while Debugging : Error while trying to run project: ... ^CrazyCoder^ ASP .Net 3 09-15-2003 09:40 AM



Advertisments