<% Dim rs1 Dim rs1_numRows Set rs1 = Server.CreateObject("ADODB.Recordset") rs1.ActiveConnection =
1个回答
展开全部
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
i=0
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<td> <table width="146" height="166" border="0">
<tr>
<td width="132" height="115"><img src="manage/<%=(rs1.Fields.Item("pic_path").Value)%>" alt="" width="140" height="130" /></td>
</tr>
<tr>
<td height="22"><span class="STYLE2"><%=(rs1.Fields.Item("info_name").Value)%></span></td>
</tr>
<tr>
<td><span class="STYLE2"><%=(rs1.Fields.Item("info_content").Value)%></span></td>
</tr>
</table></td>
<%
i=i+1
if i mod 5 = 0 then response.Write "</tr><tr>"
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</tr>
</table>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
可以通过修改if i mod 5后面的数字控制每行显示个数!
请参考
<!--#include file="Connections/ggx.asp" -->
<%
Dim rs1
Dim rs1_cmd
Dim rs1_numRows
Set rs1_cmd = Server.CreateObject ("ADODB.Command")
rs1_cmd.ActiveConnection = MM_ggx_STRING
rs1_cmd.CommandText = "SELECT * FROM info_total"
rs1_cmd.Prepared = true
Set rs1 = rs1_cmd.Execute
rs1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 10
Repeat1__index = 0
rs1_numRows = rs1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>repeat</title>
<style type="text/css">
<!--
.STYLE2
-->
</style>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%
i=0
While ((Repeat1__numRows <> 0) AND (NOT rs1.EOF))
%>
<td> <table width="146" height="166" border="0">
<tr>
<td width="132" height="115"><img src="manage/<%=(rs1.Fields.Item("pic_path").Value)%>" alt="" width="140" height="130" /></td>
</tr>
<tr>
<td height="22"><span class="STYLE2"><%=(rs1.Fields.Item("info_name").Value)%></span></td>
</tr>
<tr>
<td><span class="STYLE2"><%=(rs1.Fields.Item("info_content").Value)%></span></td>
</tr>
</table></td>
<%
i=i+1
if i mod 5 = 0 then response.Write "</tr><tr>"
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rs1.MoveNext()
Wend
%>
</tr>
</table>
</body>
</html>
<%
rs1.Close()
Set rs1 = Nothing
%>
可以通过修改if i mod 5后面的数字控制每行显示个数!
请参考
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询