滚动图片效果的问题 我的目的是想从数据库中读取图片,图片是以二进制保存到access中的.

来源:百度知道 编辑:UC知道 时间:2024/05/30 03:43:01
滚动图片效果的问题 我的目的是想从数据库中读取图片,图片是以二进制保存到access中的.然后动态的输出,出现滚动的效果.目前我的代码出现不显示图片,但是出现滚动的边框.
具体代码如下:
<!-- rs_Product("img")是图片地址, rs_Product("Photo_Name") 是产品名字-->
<style type="text/css">
div.image{background-color:#000000;}
div.scroll{margin:10px;width:550px;height:110px;overflow:hidden;background-color:#cccccc;}
div.scroll table{left:0px;width:100%;position:relative;}
div.scroll table td{white-space:nowrap;}
div.scroll table td img{height:100px;margin:0px 5px;border:0px;}
</style>
<div class="image">
<div class="scroll" onmouseover="clearInterval(timer);" onmouseout="timer = setInterval(play, 20);">
<table id="scroll_field"><tr><td>
<p>
<%
set rs_Product=server.createobject("adodb.recordset")
sqltext="select * from ImgData order by InTime desc&quo

显示从数据库中读取的二进制图片的代码如下,可以参考:

showimg.asp
<!--#include file="conn.asp" -->
<%
name=request.QueryString("id")
set rs=server.CreateObject("adodb.recordset")
strsql="select * from userinfo where UserName=" & name
rs.open strsql,conn,1,1
Response.ContentType = "image/*"
Response.BinaryWrite rs("Image").getChunk(7500000)
rs.close
set rs=nothing
set conn=nothing
%>