我想用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
%> 展开
<!--#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
%> 展开
3个回答
展开全部
<% 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
%>
<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 ""
%>
展开全部
===========================
================改成
<%
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
%>
==================================
================改成
<%
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
%>
==================================
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
解决了没?
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询