| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1296 人关注过本帖
标题:asp读取access图片路径,显示问题,贴出全部代码,请高手指点
只看楼主 加入收藏
gxhgxh
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2010-4-17
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:7 
asp读取access图片路径,显示问题,贴出全部代码,请高手指点
index.asp
---------

<img src="show.asp?id=<%=id%>" width='120' height='80'>



show.asp
--------
<!--#include file="coon.asp"-->
<%
id=12
set rs=server.createobject("Adodb.recordset")
    sql="select * from pic where id="&id
    rs.open sql,conn,3,2
    response.write rs("imgbig")

%>


conn.asp
---------
<%
db="jg.mdb"
 Set conn = Server.CreateObject("ADODB.Connection")
 conn.Open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&Server.MapPath(db)
%>



jg.mdb
表pic
-------
id         12,13,14
imgbig     uploat/img1.jpg, uploat/img2.jpg,  uploat/img3.jpg




uploat 是文件夹
含有img1.jpg ,img2.jpg ,img3.jpg三张图片



请高手指点:
我的index.asp ,不能显示图片。

如何修改是好。





[ 本帖最后由 gxhgxh 于 2010-4-17 13:45 编辑 ]
搜索更多相关主题的帖子: 代码 asp 路径 access 
2010-04-17 13:44
孤独冷雨
Rank: 10Rank: 10Rank: 10
来 自:安徽滁州
等 级:贵宾
威 望:23
帖 子:1247
专家分:1909
注 册:2007-6-4
收藏
得分:0 
index.asp
---------

<img src="<%=rs("imgbig")%>" width='120' height='80'>

这里有男女系列成人用品,有时间兄弟们来看一看.
51za.
2010-04-17 15:37
gxhgxh
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2010-4-17
收藏
得分:0 
感谢楼上版主回复,但是没有解决我的问题,也可能我的水平不够,其实,我是想通过id传递,来显示指定的图片,
比如说:
我在show.asp 中 id=12,其实应该用session,来赋给id值,
然后在index.asp中显示出指定的图片来。

[ 本帖最后由 gxhgxh 于 2010-4-17 20:07 编辑 ]
2010-04-17 19:54
gxhgxh
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2010-4-17
收藏
得分:0 
别让我的帖子沉了,还没解决问题呀,请高手指教一下,谢谢啦!
2010-04-19 09:30
孤独冷雨
Rank: 10Rank: 10Rank: 10
来 自:安徽滁州
等 级:贵宾
威 望:23
帖 子:1247
专家分:1909
注 册:2007-6-4
收藏
得分:0 


只是你show.asp的response.write输出是图片路径,
你想显示图片就用response.write "<img src="&rs("imgbig")&" width=120 height=90>"
别的是正确的!并不是你所说的ID保存到session里。

[ 本帖最后由 孤独冷雨 于 2010-4-19 09:47 编辑 ]

这里有男女系列成人用品,有时间兄弟们来看一看.
51za.
2010-04-19 09:45
gxhgxh
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2010-4-17
收藏
得分:0 
那么,请问我的index.asp如何写呢?
2010-04-19 10:04
孤独冷雨
Rank: 10Rank: 10Rank: 10
来 自:安徽滁州
等 级:贵宾
威 望:23
帖 子:1247
专家分:1909
注 册:2007-6-4
收藏
得分:20 
index.asp:
你的给出的数据库没有看到图片名称:现在图片名称就用ID号吧!
<!--#include file="coon.asp"-->
<table width="50" border="0" align="center" cellpadding="0" cellspacing="0">
    <%set rs=server.createobject("Adodb.recordset")
    sql="select * from pic order by id desc"
    rs.open sql,conn,1,1
if rs.eof then
response.write"<Tr><td height='20' width='50' align='center'>暂无内容</td></tr>"
else
   for i=1 to rs.recordcount
%>
  <tr>
    <td height="20" width="50" align="center"><a href="show.asp?id=<%=rs("id")%>" target="_blank">图片<%=rs("id")%></a></td>
  </tr>
<%
rs.movenext
if rs.eof then exit for
next
end if
rs.close
set rs=nothing
%>
</table>
****************************************
show.asp
<!--#include file="coon.asp"-->
<%
sid=trim(request("id"))
set rs=server.createobject("Adodb.recordset")
    sql="select * from pic where id="&sid
    rs.open sql,conn,1,1
if rs.eof then
    response.write"图片不存在"
else
    response.write "<img src="&rs("imgbig")&">"
end if
%>





[ 本帖最后由 孤独冷雨 于 2010-4-19 11:35 编辑 ]

这里有男女系列成人用品,有时间兄弟们来看一看.
51za.
2010-04-19 11:32
gxhgxh
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2010-4-17
收藏
得分:0 
孤独冷雨
非常感谢!
俺对你感激涕零,无语言表!
您在,本坛之幸,额之幸也!。。。。谢谢啦。。
2010-04-19 19:39
快速回复:asp读取access图片路径,显示问题,贴出全部代码,请高手指点
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018629 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved