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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML -> Recordset using jscript

Status
Not open for further replies.

Sarky78

Programmer
Oct 19, 2000
878
GB
Hi all really hoping someone will be able to help me here

I've got some code that will access a webservice and return xml into recordset, this code is in VBScript.

Now, because we are using JScript i need to convert this code to work in the same way. ie into a recordset.

Can anyone help me with this?

this is the code
Code:
	'Fetch the data
	set oHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
	oHTTP.Open "GET", URL, false
	oHTTP.Send
	
	'Load it into the recordset
	set oRecordset = Server.CreateObject("ADODB.Recordset")
	oRecordset.Open oHTTP.ResponseStream

TIA

Tony
 
[tt] //Fetch the data
var oHTTP,oRecordset;
oHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP");
oHTTP.Open("GET", URL, false);
oHTTP.Send();

//Load it into the recordset
oRecordset = Server.CreateObject("ADODB.Recordset");
oRecordset.Open (oHTTP.ResponseStream);[/tt]
 
Correction
Forgotten to do more backspaces. Here is the corrected version.
[tt]
//Fetch the data
var oHTTP,oRecordset;
oHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP");
oHTTP.open("GET", URL, false);
oHTTP.send();

//Load it into the recordset
oRecordset = Server.CreateObject("ADODB.Recordset");
oRecordset.open (oHTTP.ResponseStream);
[/tt]
 
Tsuji,

Thanks for this, i've put your code above into the system and now get an error:
Code:
ADODB.Recordset error '800a0bb9' 

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

and it indicates the error is on this line:
oRecordset.open (oHTTP.ResponseStream);

any ideas?

Tony
 
Wrong type error: I cannot help based on the script section. It is not a syntax problem. You know to look into the response proper.
 
Try this to see what's going on.
Code:
Response.Write(oHTTP.ResponseStream);
Response.Flush();

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top