考虑分页的话,就这样写
程序代码:
<table align="center" border="1" cellpadding="0" cellspacing="0" bordercolorlight="#000000"> <tr bgcolor="#3399FF" align="center"> <td>编号</td> <td>需求部门</td> <td>需求人员</td> <td>需求人电话</td> <td>需求完成时间</td> <td>故障标题</td> <td>执行人</td> <td>分配完成时间</td> <td>执行状况</td> <td>分配情况</td> <td>详情</td> </tr> <% dim rs,sql,nd_depart,years,months,days,times,do_type,nd_data nd_depart=request("nd_depart") years=request("years") months=request("months") days=request("days") times=request("times") do_type=request("do_type") sql="where 1=1" if nd_depart<>"" then sql=sql&" and nd_depart='"&nd_depart&"'" end if if do_type<>"" then sql=sql&" and do_type='"&do_type&"'" end if if years<>"" and months<>"" and days<>"" and times<>"" then nd_data=years&"-"&months&"-"&days select case times case "制单时间" sql=sql&" and wrt_time='"&nd_data&"'" case "需求完成时间" sql=sql&" and nd_data='"&nd_data&"'" end select end if set rs=server.CreateObject("adodb.recordset") rs.open "select * from [nd_msg] "&sql,conn,1,1 do while not rs.eof rs.pagesize=10 page=cint(request("page")) if page<=0 then page=1 if page="" then page=1 rs.absolutepage=page for i=0 to rs.pagesize-1 if rs.eof or rs.bof then exit for response.write "<tr>" response.write "<td>"&rs("id")&"</td>" response.write "<td>"&rs("nd_depart")&"</td>" response.write "<td>"&left(rs("nd_name"),5)&"</td>" response.write "<td>"&rs("nd_tel")&"</td>" response.write "<td>"&rs("nd_data")&"</td>" response.write "<td>"&left(rs("nd_title"),8)&"</td>" response.write "<td>"&rs("do_man")&"</td>" response.write "<td>"&rs("do_time")&"</td>" if rs("do_type")=1 then response.write "<td>已完成</td>" else response.write "<td>未完成</td>" end if if rs("agn_type")=1 then response.write "<td>已分配</td>" else response.write "<td>未分配</td>" end if response.write "<td><a href=""viewresult.asp?id="&rs("id")&""">详情</a></td>" response.write "</tr>" rs.movenext loop rs.close response.write "</table>" conn.close %>
[编程论坛] ASP超级群:49158383 敲门暗号:ASP编程
龍艺博客 http://www.