读数据库图片存为文件

类别:软件工程 点击:0 评论:0 推荐:
<!--#include file="conn.asp" -->
<%
set rs=conn.execute("select * from youtable")
  Set oFileStream = CreateObject ("ADODB.Stream")
  oFileStream.Type = 1
set id=rs("id")
set photo=rs("photo")
do while rs.eof=false
 oFileStream.Open
 oFileStream.Write photo.value
 oFileStream.SaveToFile "d:\photo"& id &".jpg",2
 oFileStream.close
 rs.movenext
loop
set  oFileStream=nothing
set photo=nothing
set id=nothing
rs.close
set rs=nothing
call closedatabase()
%>

本文地址:http://com.8s8s.com/it/it33529.htm