<%
Response.Buffer = True
Response.Clear()
set rec=server.createobject("adodb.recordset"
sqlcmd="select * from pvrhotshows"
rec.open sqlcmd,conn,1,3
response.contenttype = "image/*"
do while rec.eof=false
response.binarywrite rec("picture"
.getchunk(7500000) +"<br>"
rec.movenext
loop
'response.write rec("showid"
rec.close
set rec=nothing
set conn=nothing
%>
===================================
或看以下代码
<!--#include file="config/conn.asp"-->
<html>
<head>
<title>aaaaaaaaaa</title>
<meta http-equiv="Content-Type"
content="text/html;
charset=gb2312">
<link rel="stylesheet"
href="css.css"
type="text/css">
<script language="JavaScript"
type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr;
for(i=0;a&&i<a.length&&(x=a
)&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document;
if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments;
for(i=0;
i<a.length;
i++)
if (a.indexOf("#"!=0){ d.MM_p[j]=new Image;
d.MM_p[j++].src=a;}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x;
if(!d) d=document;
if((p=n.indexOf("?")>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document;
n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n];
for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document);
if(!x &&
d.getElementById) x=d.getElementById;
return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments;
document.MM_sr=new Array;
for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x;
if(!x.oSrc) x.oSrc=x.src;
x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
.bd {
color: #316195;
font-family: "宋体";
font-size: 9pt;
line-height: 150%;
}
.yedi {
font-family: "宋体";
font-size: 9pt;
color: #000000;
text-decoration: none;
}
a:link {
color: #111111;
text-decoration: none;
}
a:visited {
color: #111111;
text-decoration: none;
}
a:hover {
color: #ff9900;
text-decoration: none;
}
-->
</style>
</head>
<body bgcolor="#0a61a4"
topmargin="0"
onLoad="MM_preloadImages('img/website_co_02.gif','img/website_co_04.gif',' img/website_co_06.gif','img/website_co_08.gif','img/website_co_10.gif','im g/website_co_11.gif')">
<script language=javascript>
function showpict(id)
{
window.open("showpict.asp?id="+id, "NewWindow","toolbar =no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizab le=no,copyhistory=no,width=600,height=500,left=120,top=10"
}
</script>
</script>
<%
dim sql,rs,i,Page,iPage,id,j,k,l
sql="select * from pict order by id desc"
set rs=server.createobject("adodb.recordset"
rs.open sql,conn,1,3
rs.PageSize = 16
Page=request("Page"
if trim(Page)=""
then
Page="1"
Page = CLng(Page)
If Page < 1 then
Page = 1
If Page > rs.PageCount then
Page = rs.PageCount
%>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 height="100%"
width=778>
<TBODY>
<TR>
<TD
background=img/images-001.gif
width=6></TD>
<TD vAlign=top width=766> <table width="766"
height="132"
border="0"
cellpadding="0"
cellspacing="0">
<tr>
<td width="766"
height="82"
valign="top"></td>
</tr>
<TR>
<TD
height=30><img src="img/menubg111.jpg"
width="766"
height="31"
border="0"
usemap="#Map"></TD>
</TR>
<TD height=118 background="img/8.jpg"> </TD>
</table>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=766 height="423">
<TBODY>
<TR>
<TD bgColor=#f1f1f1 height=423 vAlign=top width=179 rowspan="3"> <TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD
height=24><img src="img/zbbb.jpg"
width="188"
height="25"></TD>
</TR>
</TBODY>
</TABLE>
<TABLE width=188 height="546"
border=0 align="center"
cellPadding=0 cellSpacing=0>
<TBODY>
<TR vAlign=top>
<TD width=188 height="546"
background=img/aboutus_bk_02.gif>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=188>
<TBODY>
<TR>
<TD vAlign=top><IMG height=9
src="img/aboutus_menu_01.gif"
width=188></TD>
</TR>
<TR>
<TD vAlign=top><A
href="gsyj.asp"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image15','','img/website_co_02.gif',1)"><IMG
border=0 height=36 name=Image15
src="img/website_co_01.gif"
width=188></A></TD>
</TR>
<TR>
<TD vAlign=top><a
href="hyxw.asp"
onMouseOut=MM_swapImgRestore()
onMouseOver="MM_swapImage('Image23','','img/website_co_04.gif',1)"><img
src="img/website_co_03.gif"
name=Image23
width=188 height=36
border=0></a></TD>
</TR>
<TR>
<TD vAlign=top><A
href="zytz.asp"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image10','','img/website_co_06.gif',1)"><IMG
border=0 height=36 name=Image10
src="img/website_co_05.gif"
width=188></A></TD>
</TR>
<TR>
<TD vAlign=top><a href="lxwm.asp"
onMouseOut=MM_swapImgRestore()
onMouseOver="MM_swapImage('Image141','','img/website_co_08.gif',1)"><img
border=0 height=36 name=Image141
src="img/website_co_07.gif"
width=188></a></TD>
</TR><TR>
<TD height="36"
vAlign=top><A href="#"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image109','','img/website_co_11.gif',1)"><IMG
border=0 height=36 name=Image109
src="img/website_co_12.gif"
width=188></A></TD>
</TR>
<TR>
<TD height="36"
vAlign=top><A href="zlxz.asp"
onmouseout=MM_swapImgRestore()
onmouseover="MM_swapImage('Image100','','img/website_co_10.gif',1)"><IMG
border=0 height=36 name=Image100
src="img/website_co_09.gif"
width=188></A></TD>
</TR>
<TR>
<TD vAlign=top><IMG height=23
src="img/website_main_01.gif"
width=188></TD>
</TR>
<TR>
<TD height="18"
vAlign=top>&nbsp;</TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE></TD>
<TD bgColor=#999999 width=1 height="423"
rowspan="3"></TD>
<TD bgColor=#ffffff vAlign=top width=586 height="35">
<% if rs.eof=false and rs.bof=false then
rs.AbsolutePage = Page
For iPage = 1 To 4
%>
<table width="490"
height="94"
border="0"
cellpadding="0"
cellspacing="0">
<tr>
<%for j=1 to 4
if rs.eof=true then
exit for
id=""&rs("id"
%>
<td width="1"
height="1"
valign="top"> <a href="#"
onClick="showpict('<%=id%>')"><img src="ShowImageFromData.asp?id=<%=id%>"
width="137"
height="122"
border="1"
bordercolorlight="#5c7bad"
bordercolordark="#ffffff"></a>
</td>
<%
k=k+1
if k>=16 then
exit for
rs.movenext
if rs.eof=true then
exit for
next
%>
</tr>
<%
next
end if
%>
</table></TD>
<tr>
<TD bgColor=#ffffff vAlign=top width=586 height="15">
<p align="right"><font color="#0000FF"
size="2"
face="宋体">共[<%=rs.recordcount%>
]条记录,每页20条记录,共[<%=rs.pagecount%>
]页。</font></TD>
</tr>
<tr>
<TD bgColor=#ffffff vAlign=top width=586 height="514">
<div ALIGN="center">
<center>
<table height="37"
style="font-family: 宋体;
font-size: 10pt">
<font color="#0000FF"
size="2"
face="宋体">
<form ACTION="<%=Myself%>"
METHOD="POST">
<tr>
<td height="33">
<p><%If Page <> 1 then
' 如果不是位于第一页%>
<a href="<%=Myself%>?Page=1">第一页</a>
<a HREF="<%=Myself%>?Page=<%=(Page-1)%>">上一页</a>
<%
End If
If Page <> rs.PageCount then
' 如果不是位于最后一页
%>
<a HREF="<%=Myself%>?Page=<%=(Page+1)%>">下一页</a>
<a HREF="<%=Myself%>?Page=<%=rs.PageCount%>">最后一页</a>
<% End If %>
输入页次:<input NAME="Page"
SIZE="3"
CLASS="s01">
页次:<%=Page%>
/</font><font COLOR="Red"
SIZE="2"
face="宋体"><%=rs.PageCount%>
</font></p>
<p> </td>
</tr>
</form>
</table>
</center>
</div>
<p> </TD>
</tr>
</TBODY>
</TABLE>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<table width="100%"
border="0"
cellspacing="0"
cellpadding="0">
<tr>
<td><TABLE border=0 cellPadding=0 cellSpacing=0 width=766>
<TBODY>
<TR>
<TD bgColor=#e3e3e3 height=5></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<tr>
<td><TABLE border=0 cellPadding=0 cellSpacing=0 width=766>
<TBODY>
<TR>
<TD bgColor=#ffffff height=1></TD>
</TR>
<TR>
<TD bgColor=#1a83cb height=6></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
<tr>
<td><TABLE border=0 cellPadding=5 cellSpacing=0 width=766>
<TBODY>
<TR>
<TD background=img/aboutus_bk_02.gif > <DIV align=center>
<p class="yedi"
><a href="index.asp">回到首页</a> |<a href="index.asp">
公司简介</a> | 联系我们<BR>
<br>
Copyright(C) </p>
</DIV></TD>
</TR>
</TBODY>
</TABLE></td>
</tr>
</table></TD>
<TD
background=img/images-002.gif
width=6></TD>
</TR>
</TBODY>
</TABLE>
<map name="Map">
<area shape="rect"
coords="254, 6, 300, 28"
href="index.asp">
<area shape="rect"
coords="326, 6, 394, 24"
href="zhiye.asp">
<area shape="rect"
coords="414, 4, 482, 26"
href="zhaobaioxx.asp">
<area shape="rect"
coords="506, 7, 570, 27"
href="zbgs.asp">
<area shape="rect"
coords="602, 6, 662, 28"
href="zcfg.asp">
<area shape="rect"
coords="690, 6, 760, 28"
href="addyhly.asp">
</map>
</body>
</html>
=========================
ShowImageFromData.asp
<!--#include file="config/conn.asp"-->
<%
dim sql,id,rs
id =request("id"
if id = ""
then
response.end
sql = "select * from pict where id="
&
trim(id)
set rs=server.createobject("adodb.recordset"
rs.open sql,conn,1,3
if isnull(rs(0))=false then
response.ContentType ="image/*"
' rs("picttype"
response.BinaryWrite rs("pict"
else
response.write "暂无图片"
end if
rs.close
set rs = nothing
%>