#12003/12/4 15:26:25
代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/fbook.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_fbook_STRING
Recordset1.Source = "SELECT * FROM f_bbs"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = 3
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<link href="1.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="75%" border="1" cellpadding="2" cellspacing="0" class="px12">
<tr bgcolor="#FF9900">
<td width="25%">姓名</td>
<td width="25%">QQ</td>
<td width="25%">HOMEPAGE</td>
<td>
<p>CONTENT</p></td>
</tr>
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<%If (Repeat1_numRows Mod 2) Then %>
<tr bgcolor="#FFFF99">
<%Else%>
<tr bgcolor="#FFFFFF">
<%End If%>
<td><%=(Recordset1.Fields.Item("f_name").value)%></td>
<td><%=(Recordset1.Fields.Item("f_qq").value)%></td>
<td><%=(Recordset1.Fields.Item("f_homepage").value)%></td>
<td><%=(Recordset1.Fields.Item("f_content").value)%></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
<% End If ' end Not Recordset1.EOF Or NOT Recordset1.BOF %>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
=====================================
加色代码目的是让它隔行显示颜色。但是不知错在哪里,请指教。