Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem returning Resultset from COM to ASP

Status
Not open for further replies.

zto

Programmer
Sep 19, 2001
4
SE
I have a COM Object created in PowerBuilder which queries a database and returns an ADO resultset. I also have an ASP page calling this object.
I know i get a connection with the object and the function works fine but when i want to populate the recordset i get the following message:

"An exeption of type '?k?' was not handled"

Can anyone give me a hint of what i am doing wrong?

Thanks

//ZTO

I have used the following code to create the object and handle the returned result.

Dim clss_com
dim cls_recset
dim conn

' Creating a recordset to handle the returned data

Set conn = Server.CreateObject("ADODB.Connection")
Set cls_recset = Server.CreateObject_("ADODB.RecordSet")

'Creating the com object

strClassString ="PB80.n_clssrch.1.0"
Set clss_com = Server.CreateObject(strClassString)

'sending value to test1 and handeling result. This is where
'i have problems

cls_recset = clss_com.of_test1(4)

 
Is your COM object returning a recordset or variant? I think that VBScript has a problem if it's not returned as a variant... don't quote me on this though...
 
Thanks for the replies.

If i am currectly informed the returned value is now a variant, however i get the error message '0xFFFFDF80' and i haven't been able to find any info about it. I am using the same code as before but this time i have tried to skip the connection object and the recordset object (since these really aren't needed)I really can't see what i am doing wrong but maby this is because i'm new to ASP :)
 
do you have the on error resume ... or on error goto ... in your VB COM object? If you do, take it out, it'll help debugging alot. It seems like you are having a problem with the creation in the COM object... I *think* that your problem lies there...

hth
leo
 
Thanks,

I'll forward that to my boss - whos creating the com object. :)
But, since i havent had any time to spare i told him to use another solution. It is a real uggly one but my deadline is on Monday morning. Now i wonder if it is possible to create a 3D array in a ASP session object. A list that contains
ID, No, String that i can populate and use as a very simple "shoping cart". Have any pointers? It seems as if my problem is that a sessiono object prefers to have a string and nothing else.

/ ZTO
 
Try not creating the ADO connection and recordset object in your ASP page and doing this:

<%
dim oMyObject
dim oMyRS
dim strClassString

strClassString =&quot;PB80.n_clssrch.1.0&quot;

'this is your COM object
set oMyObject = Server.CreateObject(strClassString)

'usually there is a method in the COM object which
'returns an ADO recordset (the COM method should have
'ADODB.RecordSet as its return type.
set oMyRS = oMyObject.MethodWhichReturnsRS

'oMyRS is a disconnected RS - call ADO properties and
'methods

oMyRS.Open
oMyRS.MoveFirst
response.write oMyRS.Fields(&quot;FieldName&quot;)

'clean up
set oMyObject = nothing
set oMyRS = nothing

'Hope this helps.

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top