用ASP从数据库中取出图片并显示在网页任意位置上?????

来源:百度知道 编辑:UC知道 时间:2024/09/28 15:10:04
问题如上。
我用ASP从数据库中取出图片并显示在网页上,但是不能加表格,否出现乱码。

-------------------------------------
正常程序如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conndb.asp"-->
<%
Set rs=Server.CreateObject("ADODB.Recordset")
rs.open "select * from admin where do=1",conn
response.ContentType="image/jpeg"
response.BinaryWrite rs("photo").getChunk(7500000)
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
________________________

当加上表格之后出现乱码,如下程序:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conndb.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<bo

将正常程序这段代码保存成单独文件,如:showImage.asp;
然后在其他地方用<img src="showImage.asp"/> 来调用,如:
<table width="200" border="1">
<tr>
<td>
<img src="showImage.asp"/>
</td>
</tr>
</table>