473,394 Members | 1,737 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,394 software developers and data experts.

Pass Recordset from Web Service to Classic ASP.

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.

Dec 2 '05 #1
3 3661
Ted Ngo wrote:
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.

See this thread:
http://groups.google.com/group/micro...9ded2e3b036cec

Bob Barrows
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 2 '05 #2
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

Dec 2 '05 #3
Yes, that's what I had in mind. Also, see Adam's last message in that
thread.

Bob
Ted Ngo wrote:
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


--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Dec 2 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

19
by: Adam Short | last post by:
I am trying to write a routine that will connect a .NET server with a classic ASP server. I know the following code doesn't work! The data is being returned as a dataset, however ASP does not...
3
by: Lyn | last post by:
Hi, I have been experiencing a problem passing a LIKE statement in the WHERE argument of a DoCmd.Openform statement. I have posted that issue separately. However, in an attempt to work around...
18
by: Darryl Kerkeslager | last post by:
When I open an ADO Recordset, I close it. However, it seems that there may be some difference in this manner of opening a Recordset: Dim rL As ADODB.Recordset Set rL = New ADODB.Recordset ...
6
by: Karl Stankiewicz | last post by:
Does any know how to return a recordset object from COM+ component written in C# so that it can be used as a Recordset in classic ASP? I have the frame component written i'm just not sure what...
1
by: Khurram Hanif | last post by:
I've a pre-written application using ASP with ADO. Recordset used in the application to update database. When i try to add a record it shows error like "Microsoft JET Database Engine (0x80040E09)...
9
by: Alan Silver | last post by:
Hello, I'm a bit surprised at the amount of boilerplate code required to do standard data access in .NET and was looking for a way to improve matters. In Classic ASP, I used to have a common...
2
by: Mark | last post by:
Hello - From an Access VBA module, I'm trying to pass a Table to a VB.Net class. I'm getting the following error running the VBA: "Unable to cast object of type System._ComObject to type...
6
by: James | last post by:
I am writing a web service for a classic ASP application. I need to consume an ADO recordset and then send it to another web service for processing. I found an MSDN ariticle telling how to do this...
5
by: slowmotiongenius | last post by:
All- I have established an adodb recordset in my code-behind, and I need to pass it to the aspx file. I can't seem to figure out if there is a way to do this. I see you can pass a string over...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.