问题是这样的 有一个记录项目详细信息的数据表,然后又建立了另外一个项目参加人员的数据表.每一个项目可以添加若干个参加人员. 当我需要按照项目参加人员的姓名来查询项目的时候.却实现不了分页的功能 请问有没有人遇到过类似的问题,我也不知道问题陈述清楚了没有. 下面我把我的程序抄下来吧.请高手帮我看看 <% if request.cookies("adminer")<>"true" then response.redirect "login.asp" end if %> <!--#include file="conn.asp"--> <html>
<head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>项目信息管理</title> <meta name="GENERATOR" content="Microsoft FrontPage 6.0"> <link rel="stylesheet" href="style.css"> <script language="javascript"> function newwin(url) { var wth=window.screen.width; var hth=window.screen.heigth; var lefth; var topth; if(wth==1024) { hth=800; lefth =10; wth=800; topth=20; } else if(wth==800) { hth=500; lefth =35; wth=500; topth=10; } else { hth=600; wth=500; } var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left="+lefth+",top="+topth+";width="+wth+",height="+hth; var newwin=window.open(url,"newwin",oth); return false; } function ifdel_pro() { if (confirm("您真的要删除该项目?")) { return true;} return false; } </script> </head>
<body link="#000080"> <center> <p></p> <p align="center"><b><font size="3" color="#6600CC">您按照 项目参与人 查询的结果如下所示:</font></b></p>
<table align=center border="1" cellspacing="0" width="84%" bgcolor="#ccccFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF" style='FONT-SIZE: 9pt' height="55"> <tr> <td width="40%" align="center" bgcolor="#CC99FF" height="27"><strong>项目名称</strong></td> <td width="17%" align="center" bgcolor="#CC99FF" height="27"><strong>项目类别</strong></td> <td width="15%" align="center" bgcolor="#CC99FF" height="27"><strong>项目负责人</td> <td width="24%" align="center" colspan="4" bgcolor="CC99FF" height="27"><strong> 操作</strong></td> </tr> <% dim keyword,rsm keyword=request.querystring("keyword") Set rsm = Server.CreateObject("ADODB.RecordSet") sqlm="select Id from bmember where MemName='"&keyword&"'order by MId" rsm.open sqlm,conn,1,1 If rsm.EOF Then Response.Write "<tr><td colspan=7 align=center>目前还没有参加任何项目。</td></tr></table>" Else rsm.PageSize = 2
Page = CLng(Request("Page"))
If Page < 1 Then Page = 1 If Page > rsm.PageCount Then Page = rsm.PageCount '设置当前页码为Page rsm.AbsolutePage = Page
For i = 1 to rsm.PageSize if rsm.EOF then Exit For dim rs,rscate Set rs = Server.CreateObject("ADODB.RecordSet")
sql="select * from bprogram where Id="&rsm("Id") set rs=conn.execute(sql) %>
<tr> <td align="center" width="40%" hight="27" bgcolor="#CCCCFF"><a href="pro_detail.asp?id=<%=rs("id")%>" onClick="return newwin(this.href)"><%=rs("ProName")%></a></td> <% sqlcate="select * from bcategory where CateId="&rs("CateId") Set rsCate = conn.Execute(sqlcate) %> <td align="center" width="18%" hight="27" bgcolor="#CCCCFF"><%=rscate("Catename")%></td> <td align="center" width="10%" hight="27" bgcolor="#CCCCFF"><%=rs("Principal")%></td> <td align="center" width="5%" hight="27" bgcolor="#CCCCFF"><a href="Pro_edit.asp?id=<%=rs("id")%>" onClick="return newwin(this.href)">编 辑</a></td> <td align="center" width="5%" hight="27"><a href="Partner_search_del.asp?id=<%=rs("id")%>&catename=<%=catename%>&keyword=<%=keyword%>" onclick="ifdel_pro()">删 除</a></td> <td align="center" width="7%" hight="27" bgcolor="#CCCCFF"><a href="Equip_add.asp?id=<%=rs("id")%>" >添加设备</a></td> <td align="center" width="7%" hight="27" bgcolor="#CCCCFF" width="7%"><a href="Member_add.asp?id=<%=rs("id")%>" >添加成员</a></td> </tr> <% rsm.MoveNext() next %> </table> <% If rsm.pagecount>1 then Response.Write "<table border='0'><tr><td> 当前第<font color='red'><b>"&page&"</b></font>页<b> 分页:</b></td>" For i = 1 To rsm.PageCount Response.Write "<td><a href='Partner_search.asp?&keyword="&keyword&"&page=" & i & "'>" Response.Write "[<b>" & i & "</b>]</a></td>" Next Response.Write "</tr></table>" End If rsm.close set rsm=nothing conn.close set conn=nothing end if %>
<p align="center"> <font color="#FFCC00"><b><a href="Pro_query.asp"> <font color="#FF0000">返 回</font></a></b> </font> </p> </centen> </body> </html> 先谢了