asp从数据库里读取图片
<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transiti...
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>直接连接数据库</title>
</head>
<body>
<%
set objconn=Server.CreateObject("ADODB.CONNECTION")
objconn.open"Driver={microsoft access driver (*.mdb)};DBQ="&server.MapPath("db1.mdb")
set rs=server.CreateObject("ADODB.Recordset")
rs.open"select * from tupian",objconn,1,1
do while not rs.bof and not rs.eof
%>
<img src="<%=rs("gif")%>"
<%
rs.movenext
loop
%>
</body>
</html>
我想实现从把数据库中保存的图片读取出来,显示在页面上。可是总是显示“X”,请高手指点。
还是没有显示图片出来,显示的还是“X” 展开
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>直接连接数据库</title>
</head>
<body>
<%
set objconn=Server.CreateObject("ADODB.CONNECTION")
objconn.open"Driver={microsoft access driver (*.mdb)};DBQ="&server.MapPath("db1.mdb")
set rs=server.CreateObject("ADODB.Recordset")
rs.open"select * from tupian",objconn,1,1
do while not rs.bof and not rs.eof
%>
<img src="<%=rs("gif")%>"
<%
rs.movenext
loop
%>
</body>
</html>
我想实现从把数据库中保存的图片读取出来,显示在页面上。可是总是显示“X”,请高手指点。
还是没有显示图片出来,显示的还是“X” 展开
2个回答
展开全部
这样就可以了,你把数值相应的改下就行了:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>直接连接数据库</title>
</head>
<body>
<%
set objconn=Server.CreateObject("ADODB.CONNECTION")
objconn.open"Driver={microsoft access driver (*.mdb)};DBQ="&server.MapPath("db1.mdb")
set rs=server.CreateObject("ADODB.Recordset")
rs.open"select * from tupian",objconn,1,1
do while not rs.bof and not rs.eof
%>
<img src="<%=rs("gif")%>" width="315" height="130"/>
<%
rs.movenext
loop
%>
</body>
</html>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>直接连接数据库</title>
</head>
<body>
<%
set objconn=Server.CreateObject("ADODB.CONNECTION")
objconn.open"Driver={microsoft access driver (*.mdb)};DBQ="&server.MapPath("db1.mdb")
set rs=server.CreateObject("ADODB.Recordset")
rs.open"select * from tupian",objconn,1,1
do while not rs.bof and not rs.eof
%>
<img src="<%=rs("gif")%>" width="315" height="130"/>
<%
rs.movenext
loop
%>
</body>
</html>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询