Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 09:21 AM
Sudhakar Sankar
Guest
 
Posts: n/a
Default Error while getting Recordset from component in ASP

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.
  #2  
Old July 19th, 2005, 09:21 AM
Bob Barrows
Guest
 
Posts: n/a
Default Re: Error while getting Recordset from component in ASP

Sudhakar Sankar wrote:[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]

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"


  #3  
Old July 19th, 2005, 09:22 AM
Mark Schupp
Guest
 
Posts: n/a
Default Re: Error while getting Recordset from component in ASP

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]


 

Bookmarks

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 Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles