$在线等待(大侠请...关于adodb.stream)在线等待$

如何把数据库中的二进制的字段提取出来,并存放到adodb.stream对象中.
---------------------------------------------------------------

http://expert.csdn.net/Expert/topic/1119/1119255.xml?temp=.4417688

有Adodb.Stream用法
---------------------------------------------------------------

//微软的帮助
你到$:\Program Files\Microsoft Office\Office\2052\ACMAIN9.CHM里可以查阅到中文的ado帮助

1   
2Response.Write "

<h3>Server-side processing</h3>

 1"   
 2  
 3Dim adoConn   
 4Set adoConn = Server.CreateObject("ADODB.Connection")   
 5  
 6Dim sConn   
 7sConn = "Provider=sqloledb;Data Source=(local);Initial Catalog=Northwind;User ID=sa"   
 8adoConn.ConnectionString = sConn   
 9adoConn.CursorLocation = adUseClient   
10adoConn.Open   
11  
12Dim adoCmd   
13Set adoCmd = Server.CreateObject("ADODB.Command")   
14Set adoCmd.ActiveConnection = adoConn   
15  
16Dim sQuery   
17sQuery = "

<root xmlns:sql="urn:schemas-microsoft-com:xml-sql"><sql:query>SELECT * FROM PRODUCTS ORDER BY PRODUCTNAME FOR XML AUTO</sql:query></root>

 1"   
 2  
 3Dim adoStreamQuery   
 4Set adoStreamQuery = Server.CreateObject("ADODB.Stream")   
 5adoStreamQuery.Open   
 6adoStreamQuery.WriteText sQuery, adWriteChar   
 7adoStreamQuery.Position = 0   
 8  
 9adoCmd.CommandStream = adoStreamQuery   
10adoCmd.Dialect = "{5D531CB2-E6Ed-11D2-B252-00C04F681B71}"   
11  
12Response.write "Pushing XML to client for processing " & "

<br/>

1"   
2  
3adoCmd.Properties("Output Stream") = Response   
4Response.write "

<xml id="MyDataIsle">"
adoCmd.Execute , , adExecuteStream
Response.write "</xml>

1"   
 1<script event="onload" for="window" language="VBScript">   
 2  
 3Dim xmlDoc   
 4Set xmlDoc = MyDataIsle.XMLDocument   
 5xmlDoc.resolveExternals=false   
 6xmlDoc.async=false   
 7  
 8Dim root, child   
 9Set root = xmlDoc.documentElement   
10  
11For each child in root.childNodes   
12dim OutputXML   
13OutputXML = document.all("log").innerHTML   
14document.all("log").innerHTML = OutputXML & "<LI>" & child.getAttribute("ProductName") & "</LI>"   
15Next   
16  
17</script>
Published At
Categories with Web编程
comments powered by Disqus