Pass Recordset from Web Service to Classic ASP.

T

Ted Ngo

I want to use the .net Web Service to create a function and return the
datas (RecordSet). And want to retrived those data on the classic ASP.
Does any body have some example of this. How to create the Recordset in
webservice and get it at classic asp.

Thanks and Regards.
 
T

Ted Ngo

so I using this

Or, you can send the XML of the ADO recordset back, and re-construct it
on
the client. Use Interop on the server to work with the ADO recordset.


// ON THE SERVER -- Web Service
// Add references to ADODB library


// Create a stream object
myStream = new ADODB.Stream();


// Replace the constants with their actual values
recordSet.Save(myStream, adPersistXML);
output = myStream.ReadText(adReadAll);


// Return the XML string, complete with schema
return output;

To return the recorset

and then on the asp using this to get the record set

Public Function RecordsetFromXMLString(sXML As String) As Recordset

Dim oStream As ADODB.Stream
Set oStream = New ADODB.Stream

oStream.Open
oStream.WriteText sXML 'Give the XML string to the ADO Stream

oStream.Position = 0 'Set the stream position to the start

Dim oRecordset As ADODB.Recordset
Set oRecordset = New ADODB.Recordset

oRecordset.Open oStream 'Open a recordset from the stream

oStream.Close
Set oStream = Nothing

Set RecordsetFromXMLString = oRecordset 'Return the recordset

Set oRecordset = Nothing

End Function

Is that righ?

Thanks
 
B

Bob Barrows [MVP]

Yes, that's what I had in mind. Also, see Adam's last message in that
thread.

Bob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,808
Messages
2,569,686
Members
45,453
Latest member
RamonMcCom

Latest Threads

Top