Re: displaying XML in IE by Han
Han
Fri Dec 05 22:28:04 CST 2003
This worked for me.
<%
Response.ContentType="text/xml"
Response.Write "<x>"
strcon="provider=SQLOLEDB;Data Source=hr01;Initial Catalog=MCSP_OUT;User
id=sa;Password=xxx"
set con=createobject("adodb.connection")
con.CursorLocation=3
con.Open strcon
set cmd=createobject("adodb.command")
cmd.ActiveConnection=con
cmd.CommandText="SELECT bank_cd FROM ac005 for xml auto"
cmd.Properties("Output Stream")=response
cmd.Execute,,1024
Response.Write "</x>"
%>
--
Pohwan Han, Microsoft MVP, ASP/ASP.Net, Korea
Have a nice day.
<anonymous@discussions.microsoft.com> wrote in message
news:00ba01c3bb49$31b2bd30$a101280a@phx.gbl...
> The rs I'm getting back is from a SQL server, and uses
> the "for xml" command, so the data is already formatted as
> xml. I'm using a stream to read in the rs. I need to
> output the rs as XML in a certain format.
> I tried your version and it works great, even though it
> gives me more than I need in the XML. But, I still don't
> see the XML in the browser window. I have to go to View >
> Source. Why not?
>
> >-----Original Message-----
> >Don't convert RS as XML. Simply save it as Response(=xml)
> >
> >rs.save response, 1
> >
> >"Sean" <swainner@oaohs.com> wrote in message
> >news:0a4e01c3bb40$a3aa8bb0$a501280a@phx.gbl...
> >> I have an asp page which reads a table and creates XML
> >> from the data, then writes it out using response.write.
> >> But, I can only see the XML when I go to View > Source
> on
> >> the Toolbar in Internet Explorer. How can I display the
> >> XML in the browser? I've set the ContentType to
> text/xml.
> >>
> >
> >
> >.
> >