我想用ASP 重复那个数据库图片 横向重复三个后换行 一共三行。。。 数据库是access的。。代码如下。。

<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%><!--#includefile="Connections/a.asp"--><%DimRec... <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/a.asp" -->
<%
Dim Recordset1__MMColParam
Recordset1__MMColParam = "1"
If (Request.QueryString("name") <> "") Then
Recordset1__MMColParam = Request.QueryString("name")
End If
%>
<%
Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_a_STRING
Recordset1.Source = "SELECT * FROM fobu WHERE tm <> '" + Replace(Recordset1__MMColParam, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = 9
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文件</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body>
<TABLE width=800>
<TBODY>
<TR>
<TD><table width="800" height="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="index/conf1.jpg"><table width="138" height="131" border="0" align="center" cellpadding="3" cellspacing="1">
<TD width="154" height="130">
<div align="center"><BR>
<a href="xiangxi.asp?id=<%=(Recordset1.Fields.Item("id").Value)%>">
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))%>
<IMG src="<%=(Recordset1.Fields.Item("tpwz").Value)%>" alt="" width="150" height="180"
border=1>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</a><BR>
</div></TD>
</TR>
</TABLE>
<P align=center><A
href="fobu.asp">回目录</A> </P></td>
</tr>
</table></TD>
</TR>
</TBODY>
</TABLE>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
展开
 我来答
缓步莫迟疑C
2012-02-02 · TA获得超过1.1万个赞
知道大有可为答主
回答量:6217
采纳率:73%
帮助的人:6412万
展开全部
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))%>
<IMG src="<%=(Recordset1.Fields.Item("tpwz").Value)%>" alt="" width="150" height="180"
border=1>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
改成
<%
Dim ii
ii = 1
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))%>
<IMG src="<%=(Recordset1.Fields.Item("tpwz").Value)%>" alt="" width="150" height="180" border=1><%
If ii = 3 Then
response.write "<br>"
ii = 1
Else
ii = ii + 1
End If
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
更多追问追答
追问
那个图片还是竖着重复啊,我要的是横着重复三个 然后换行。。
你那个改的代码试过了,还是竖着。
追答
之前给你的代码就应该是三张在一行上的, 换行的原因可能是父对象宽度不足吧,
试试下面的代码.
"
While ((Repeat1__numRows 0) AND (NOT Recordset1.EOF)) AND ii"
If ii Mod 3 = 0 AND ii9 Then response.write ""
ii = ii + 1
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
Response.Write ""
%>
chinank2003
2012-02-02 · TA获得超过372个赞
知道小有建树答主
回答量:350
采纳率:0%
帮助的人:139万
展开全部
===========================
================改成
<%
Dim ii
ii = 1
i=1
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) and i<=9%>
<IMG src="<%=(Recordset1.Fields.Item("tpwz").Value)%>" alt="" width="150" height="180" border=1><%
If ii = 3 Then
response.write "<br>"
ii = 1
Else
ii = ii + 1
End If
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
i=1+1
Recordset1.MoveNext()
Wend
%>
==================================
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
kofjjj
2012-02-04 · TA获得超过595个赞
知道小有建树答主
回答量:1167
采纳率:25%
帮助的人:525万
展开全部
解决了没?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(1)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

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

类别

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

说明

0/200

提交
取消

辅 助

模 式