473,395 Members | 1,488 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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.
Jul 19 '05 #1
2 3728
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Grahammer | last post by:
For some reason I am getting an error when trying to open a recordset on an Access database on my Win2K3 machine from my INDEX.ASP page, but the same code accesses the database fine when coming...
0
by: Johan Lachonius | last post by:
Hi, I'm using a "classic" asp-page and a .net-component which I want to call passing a Recordset as a parameter. I have a reference to ADODB in the .net component which should supply a COM...
11
by: MLH | last post by:
I copied the following code snippet from A97 HELP. Am getting an error at compile time suggesting there's a problem with the first line (compile error, user-defined type not defined). It is likely...
0
by: Andre Azevedo | last post by:
Hi all ! I've created a .net serviced component with only one method. This method receive an ADODB.Command object and execute it. The ADODB.Command object is created in the client process. (VB...
3
by: Richard Hollenbeck | last post by:
I've marked the line in this subroutine where I've been getting this error. It may be something stupid but I've been staring at this error trying to fix it for over an hour. I'm pretty sure the...
2
by: wellerc1 | last post by:
Looking for help to resolve error I am getting when I run vbs scripts. Scripts execute DLL components which use DB2 Connect to pull data. scripts does a name search creating an ADODB.Recordset...
3
by: pooja1982 | last post by:
Hi, I m getting this message after executing the following code <% CALL OPENDATACON DIM RS SET RS=SERVER.CreateObject ("ADODB.RECORDSET") s="select * from dbpassenger order by ref_no" CALL...
3
by: Kosmos | last post by:
Hey ya'll...I can't seem to figure out why I'm getting this error message, but it all started when I added the new line of code with the recSet5.AddNew --- when I ran the first line, the logic worked...
6
by: dotnetdev1 | last post by:
Hi Friends, I am new to the COM Programming..When I am executing the Code I am getting the following error..Please Help me...If anyone can understand what My error is....Thanks ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.