请问ASP图片调用的问题!急.....!!!!!!!!~~~

下面是一个picnews.asp,它只是在主页上显示一张最新的带联接的图片新闻,如何改为显示6张图片新闻呢?....谢谢!!!!<!--#includefile="con... 下面是一个picnews.asp,它只是在主页上显示一张最新的带联接的图片新闻,如何改为显示6张图片新闻呢?....谢谢!!!!

<!--#include file="conn.asp"-->
<html>
<head>
<title>图片新闻</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css.css">
</head>

<body>
<%
sql="select top 1 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
if not Rs.eof then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
<%
else
response.write "<tr><td align=center colspan=2 bgcolor=#E8E8F4>尚无收录</td></tr>"
end if
rs.close
set conn=nothing
%>
</body>
</html>
谢谢你们的回答,我已经把top 1 改为 top 6但是暂时还没有解决问题,图片还是只显示的一张,因为用FONTPAGE打开这ASP,只有一张图片的筐筐....我想改社定为六张图片..显示最新的六条图片新闻....拜托大家了.我是新手非常抱歉...:)
展开
 我来答
泰名Do
2007-01-17 · TA获得超过131个赞
知道答主
回答量:162
采纳率:0%
帮助的人:0
展开全部
我看了你的问题补充可能你要的是这种:

<!--#include file="conn.asp"-->
<html>
<head>
<title>图片新闻</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css.css">
</head>

<body>
<%
sql="select top 6 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
if not Rs.eof then
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" width="230" height="129">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
</td>
<%rs.movenext%>
<td align="center" width="230" height="129">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
</td>
<%rs.movenext%>
<td align="center" width="230" height="129">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
</td>
<%rs.movenext%>
<td align="center" width="230" height="129">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
</td>
<%rs.movenext%>
<td align="center" width="230" height="129">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
</td>
<%rs.movenext%>
<td align="center" width="230" height="129">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
</td>
</tr>
</table>
<%
else
response.write "尚无收录"
end if
rs.close
set conn=nothing
%>
</body>
</html>
度老虎
推荐于2016-05-28 · TA获得超过1548个赞
知道大有可为答主
回答量:1661
采纳率:100%
帮助的人:2372万
展开全部
用FRONTPAGE的代码模式修改,或者用记事本打开修改。
=======================================
top 1 改为 top 6,然后做个循环就可以了:
<!--#include file="conn.asp"-->
<html>
<head>
<title>图片新闻</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css.css">
</head>

<body>
<%
sql="select top 6 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
if not Rs.eof then
do while not rs.eof
%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
<%
rs.movenext
loop
else
response.write "<tr><td align=center colspan=2 bgcolor=#E8E8F4>尚无收录</td></tr>"
end if
rs.close
set conn=nothing
%>
</body>
</html>
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
百度网友9e02898
2007-01-17 · TA获得超过112个赞
知道小有建树答主
回答量:308
采纳率:0%
帮助的人:0
展开全部
我已经调试过了,复制就可以运行

<!--#include file="conn.asp"-->
<html>
<head>
<title>图片新闻</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css.css">
</head>

<body>
<%
sql="select top 6 * from NEWS where firstImageName<>'' and ok=true order by ID DESC"
set rs=conn.execute(sql)
do while not Rs.eof

%>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" height="129"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" >
<img src="uppic/<%=trim(rs("firstImageName"))%>" width="230" height="92" border="0"></a></td>
</tr>
<tr>
<td height="85" align="center"><a href="funonews.asp?id=<%=rs("id")%>" target="_blank" ><%=left(rs("title"),12)%></a></td>
</tr>
</table>
<%
if Rs.eof then
response.write "<tr><td align=center colspan=2 bgcolor=#E8E8F4>尚无收录</td></tr>"
end if
Rs.movenext
loop
rs.close
set conn=nothing
%>
</body>
</html>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式