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

ADODB.Stream

Status
Not open for further replies.

stoggers

Vendor
May 30, 2001
93
US
Hi,

Does anyone have any example scripts that use ADODB.Stream to return XML?

Thanks,

Mike.
 
Hello Mike,

I'm not sure if this is what your looking for... but I'll post it anyway,

Mark

Heres the code:

Set dbCmd.ActiveConnection = dbConn

dbCmd.CommandType = 1 'adCmdText
dbcmd.CommandText = "SELECT * FROM myTable FOR XML AUTO, ELEMENTS"

adoStream.Open
dbcmd.Properties("Output Stream").Value = adoStream
dbcmd.Execute , , 1024 'adExecuteStream

strXML = adoStream.ReadText

if strXML <> &quot;&quot; then
Set domXSL = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)
Set domData = Server.CreateObject(&quot;Microsoft.XMLDOM&quot;)

domXSL.async = false 'Don't forget to set this

domData.loadXML( &quot;<Recs>&quot; & strXML & &quot;</Recs>&quot; )

domData.Save &quot;c:\oops.xml&quot;

if domXSL.load( &quot;c:\InetPub\ ) then
strXML = domData.transformNode( domXSL )
end if

end if

Response.Write strXML
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top