怎样将Access中的图片插入到网页中显示,用的Dreamwear8
展开全部
数据库里的图片肯定是以路径来保存的,在网页制作的后台写相关输出的代码即可,例如:
<table cellspacing="0" cellpadding="0" width="96%" align="center"
border="0">
<tbody>
<tr></tr>
<tr>
<td
style="PADDING-RIGHT: 15px; PADDING-LEFT: 15px; PADDING-BOTTOM: 15px; PADDING-TOP: 15px"
valign="top" colspan="2" height="400"><div align="center">
<%
dim sql
ii=0
sql="select * from chanpin" ‘我这里是把产品的图片信息全部取出来 还包括了分页在里面
if cint(sc_id)>0 then
c_ids=GetRelatedID(sc_id)
sql=sql&"and C_ID in("&c_ids&")"
end if
skey=replace(skey," Enter Product Keyword # ","")
if skey<>"" then
sql=sql&" and (P_Name like '%"&skey&"%' or P_Instr like '%"&skey&"%')"
end if
set rs=get_rs(sql)
if rs.eof then
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100">
<tr>
<td align="center">没有发现产品……</td>
</tr>
</table>
<%
else
ps=4
rs.pagesize=ps
currentpage=request("page")
if currentpage="" then currentpage=1
if currentpage<1 then currentpage=1
if cint(currentpage)>cint(rs.pagecount) then currentpage=rs.pagecount
rs.absolutepage=currentpage
p_count=rs.pagecount
n_count=rs.recordcount
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%
ii=0
do while not rs.eof
ii=ii+1
%>
<td width="100%" align="left"><table width="465" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="465"
align="center" valign="middle"><p><a
href="admin/<%=rs("pic")%>"
target="_blank"><img src="admin/<%=rs("pic")%>" width="275" height="226" border="0" /> ’注意 这个就是取图片的值了!我这里的保存路径是在admin文件夹下面的! </a><br />
<a href="cpshow.asp?id=<%=rs("id")%>" target="_blank"><%=rs("name")%></a></p>
</td>
</tr>
</tbody>
</table>
<table width="35%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<%
if cint(ii)>0 and (ii mod 2)=0 then response.Write("</tr><td height='20'></td><tr>")
If cint(ii)>=cint(ps) Then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
%>
</tr>
<tr>
<td align="center" colspan="4"><strong> <%=currentpage%>/<%=p_count%> 共 <%=n_count%> 产品 <a href="?page=1<%=linkstr%>">第一</a> | <a href="?page=<%=currentpage-1%><%=linkstr%>">前一条</a> | <a href="?page=<%=currentpage+1%><%=linkstr%>">下一条</a> | <a href="?page=<%=p_count%><%=linkstr%>">最后</a></strong>
<%end if%></td>
</tr>
</table>
</div></td>
</tr>
</tbody>
</table>
希望对你有帮助!
<table cellspacing="0" cellpadding="0" width="96%" align="center"
border="0">
<tbody>
<tr></tr>
<tr>
<td
style="PADDING-RIGHT: 15px; PADDING-LEFT: 15px; PADDING-BOTTOM: 15px; PADDING-TOP: 15px"
valign="top" colspan="2" height="400"><div align="center">
<%
dim sql
ii=0
sql="select * from chanpin" ‘我这里是把产品的图片信息全部取出来 还包括了分页在里面
if cint(sc_id)>0 then
c_ids=GetRelatedID(sc_id)
sql=sql&"and C_ID in("&c_ids&")"
end if
skey=replace(skey," Enter Product Keyword # ","")
if skey<>"" then
sql=sql&" and (P_Name like '%"&skey&"%' or P_Instr like '%"&skey&"%')"
end if
set rs=get_rs(sql)
if rs.eof then
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100">
<tr>
<td align="center">没有发现产品……</td>
</tr>
</table>
<%
else
ps=4
rs.pagesize=ps
currentpage=request("page")
if currentpage="" then currentpage=1
if currentpage<1 then currentpage=1
if cint(currentpage)>cint(rs.pagecount) then currentpage=rs.pagecount
rs.absolutepage=currentpage
p_count=rs.pagecount
n_count=rs.recordcount
%>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<%
ii=0
do while not rs.eof
ii=ii+1
%>
<td width="100%" align="left"><table width="465" border="0" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td width="465"
align="center" valign="middle"><p><a
href="admin/<%=rs("pic")%>"
target="_blank"><img src="admin/<%=rs("pic")%>" width="275" height="226" border="0" /> ’注意 这个就是取图片的值了!我这里的保存路径是在admin文件夹下面的! </a><br />
<a href="cpshow.asp?id=<%=rs("id")%>" target="_blank"><%=rs("name")%></a></p>
</td>
</tr>
</tbody>
</table>
<table width="35%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table></td>
<%
if cint(ii)>0 and (ii mod 2)=0 then response.Write("</tr><td height='20'></td><tr>")
If cint(ii)>=cint(ps) Then Exit Do
rs.movenext
loop
rs.close
set rs=nothing
%>
</tr>
<tr>
<td align="center" colspan="4"><strong> <%=currentpage%>/<%=p_count%> 共 <%=n_count%> 产品 <a href="?page=1<%=linkstr%>">第一</a> | <a href="?page=<%=currentpage-1%><%=linkstr%>">前一条</a> | <a href="?page=<%=currentpage+1%><%=linkstr%>">下一条</a> | <a href="?page=<%=p_count%><%=linkstr%>">最后</a></strong>
<%end if%></td>
</tr>
</table>
</div></td>
</tr>
</tbody>
</table>
希望对你有帮助!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询