Pass Recordset from Web Service to Classic ASP.

  • Thread starter Thread starter Ted Ngo
  • Start date Start date
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.
 
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
 
Yes, that's what I had in mind. Also, see Adam's last message in that
thread.

Bob
 
Back
Top