谢谢班主解答啊。 这是我下的人家原码,
自己调试。结果在调试的时候,有个搜索项,点搜索就报这个错。
<%
if request.Cookies("shiwei_username")="" then
%>
<script language="javascript">
top.location.href="../index.asp"
</script>
<%
response.end
end if
%>
<!-- #include file="../conn2.asp" -->
<!-- #include file="../const.asp" -->
<html>
<head>
<title><%=dianming%> - 档案管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<style>
body {
background-color:#FFFFFF;
}
.STYLE1 {
color: #FF0000;
font-weight: bold;
}
.STYLE2 {
color: #009900;
font-weight: bold;
}
</style>
</HEAD>
<BODY>
<script>
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')
e.checked = form.chkall.checked;
}
}
</script>
<%
if fla36="0" and request.Cookies("shiwei_id")<>"1" then
%>
<br><center><img src="../images/note.gif" align="absmiddle"> <font color="#FF0000">你不具备此权限,请与管理员联系!</font></center>
<%
response.end
end if
'取得当前页码
currentpage=request("page")
'response.write currentpage
'response.end
if currentpage<1 or currentpage="" then
currentpage="1"
end if
'取得搜索关键字
nowzu=request("zu")
nowkeyword=request("keyword")
%>
<table width="100%" border="0" cellpadding="0" cellspacing="2" align="center">
<form name="form2">
<input type="hidden" name="form" value="<%=request("form")%>">
<input type="hidden" name="field" value="<%=request("field")%>">
<input type="hidden" name="field2" value="<%=request("field2")%>">
<input type="hidden" name="field3" value="<%=request("field3")%>">
<tr>
<td width="5%" height="30"> </td>
<td width="95%" align="right">
<div align="left">工作内容查询:
<%
sql="select * from leib order by id"
set rs_zu=conn.execute(sql)
%>
<select name="zu" onChange="form2.submit()">
<option value="">请工作类别</option>
<%
do while rs_zu.eof=false
%>
<option value="<%=rs_zu("id")%>"<%if trim(cstr(rs_zu("id")))=nowzu then%> selected="selected"<%end if%>><%=rs_zu("zu")%></option>
<%
rs_zu.movenext
loop
%>
</select>
<input type="text" name="keyword" size="20" value="<%=nowkeyword%>">
<input type="submit" value=" 查询 " class="button">
</div></td>
</tr>
</form>
</table>
<table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#C4D8ED">
<tr>
<td><img src="../images/r_1.gif" alt="" /></td>
<td width="100%" background="../images/r_0.gif">
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="96%"> 字体颜色说明:<span class="STYLE1">红色代表已到期</span> <span class="STYLE2">绿色代表即将到期 </span></td>
<td width="4%" align="right"> </td>
</tr>
</table>
</td>
<td><img src="../images/r_2.gif" alt="" /></td>
</tr>
<tr>
<td></td>
<td>
<form name="form1" action="gongzuo_del.asp">
<input type="hidden" name="form" value="<%=request("form")%>">
<input type="hidden" name="field" value="<%=request("field")%>">
<input type="hidden" name="field2" value="<%=request("field2")%>">
<input type="hidden" name="field3" value="<%=request("field3")%>">
<input type="hidden" name="page" value="<%=currentpage%>">
<input type="hidden" name="zu" value="<%=nowzu%>">
<input type="hidden" name="keyword" value="<%=nowkeyword%>">
<input type="hidden" name="order1" value="<%=request("order1")%>">
<input type="hidden" name="order2" value="<%=request("order2")%>">
<input type="hidden" name="order3" value="<%=request("order3")%>">
<input type="hidden" name="order4" value="<%=request("order4")%>">
<input type="hidden" name="order5" value="<%=request("order5")%>">
<input type="hidden" name="order6" value="<%=request("order6")%>">
<input type="hidden" name="order7" value="<%=request("order7")%>">
<input type="hidden" name="order8" value="<%=request("order8")%>">
<input type="hidden" name="order9" value="<%=request("order9")%>">
<input type="hidden" name="order10" value="<%=request("order10")%>">
<input type="hidden" name="order11" value="<%=request("order11")%>">
<input type="hidden" name="order12" value="<%=request("order12")%>">
<input type="hidden" name="order13" value="<%=request("order13")%>">
<input type="hidden" name="order14" value="<%=request("order14")%>">
<input type="hidden" name="order15" value="<%=request("order15")%>">
<table align="center" cellpadding="4" cellspacing="1" class="toptable grid" border="1">
<tr align="center">
<td width="17%" height="30" class="category">
<a href="?order5=<%if request("order5")="asc" then%>desc<%else%>asc<%end if%>&form=<%=request("form")%>&field=<%=request("field")%>&field2=<%=request("field2")%>&field3=<%=request("field3")%>&page=<%=currentpage%>&zu=<%=nowzu%>&keyword=<%=nowkeyword%>" class="title">工作标题
<%if request("order5")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a>
</td>
<td width="10%" class="category">
<a href="?order1=<%if request("order1")="asc" then%>desc<%else%>asc<%end if%>&form=<%=request("form")%>&field=<%=request("field")%>&field2=<%=request("field2")%>&field3=<%=request("field3")%>&page=<%=currentpage%>&zu=<%=nowzu%>&keyword=<%=nowkeyword%>" class="title">目的地
<%if request("order1")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a>
</td>
<td width="12%" class="category">
联系电话</td>
<td width="12%" class="category">
<a href="?order4=<%if request("order4")="asc" then%>desc<%else%>asc<%end if%>&form=<%=request("form")%>&field=<%=request("field")%>&field2=<%=request("field2")%>&field3=<%=request("field3")%>&page=<%=currentpage%>&zu=<%=nowzu%>&keyword=<%=nowkeyword%>" class="title">开始时间
<%if request("order4")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%></a>
</td>
<td width="15%" class="category"><a href="?order5=<%if request("order5")="asc" then%>desc<%else%>asc<%end if%>&form=<%=request("form")%>&field=<%=request("field")%>&field2=<%=request("field2")%>&field3=<%=request("field3")%>&page=<%=currentpage%>&zu=<%=nowzu%>&keyword=<%=nowkeyword%>" class="title">完成时间
<%if request("order5")="asc" then%>
<img src="../images/up2.gif" alt="1" hspace="2" border="0" align="absmiddle">
<%else%>
<img src="../images/down2.gif" alt="1" hspace="2" border="0" align="absmiddle">
<%end if%>
</a></td>
<td width="17%" class="category">
<a href="?order7=<%if request("order7")="asc" then%>desc<%else%>asc<%end if%>&form=<%=request("form")%>&field=<%=request("field")%>&field2=<%=request("field2")%>&field3=<%=request("field3")%>&page=<%=currentpage%>&zu=<%=nowzu%>&keyword=<%=nowkeyword%>" class="title">工作类别
<%if request("order7")="asc" then%><img src="../images/up2.gif" border="0" hspace="2" align="absmiddle"><%else%><img src="../images/down2.gif" border="0" hspace="2" align="absmiddle"><%end if%>
</a>
</td>
<td width="6%" class="category">任务人</td>
<%if fla37="1" or request.Cookies("shiwei_id")="1" then%>
<td class="category" width="7%">修改</td>
<%end if%>
<%if fla38="1" or request.Cookies("shiwei_id")="1" then%>
<td width="4%" class="category">删除</td>
<%end if%>
<%if fla17="1" or request.Cookies("shiwei_id")="1" then%>
<%end if%>
</tr>
<%
set rs_huiyuan =server.createobject("ADODB.RecordSet")
sql="select * from gongzuo where 1=1 "
if request.Cookies("shiwei_id")<>1 and lookhuiyuan="yes" and fla90="0" then
sql=sql&" and id_login="&request.Cookies("shiwei_id")
end if
if nowzu<>"" then
sql=sql&" and id_zu="&nowzu
end if
if nowkeyword<>"" then
sql=sql&" and (username like '%"&nowkeyword&"%' or card like '%"&nowkeyword&"%' or tel like '%"&nowkeyword&"%' or qq like '%"&nowkeyword&"%' or email like '%"&nowkeyword&"%')"
end if
if request("order1")<>"" then
sql=sql&" order by username "&request("order1")
elseif request("order2")<>"" then
sql=sql&" order by xinbie "&request("order2")
elseif request("order3")<>"" then
sql=sql&" order by qq "&request("order3")
elseif request("order4")<>"" then
sql=sql&" order by startdate "&request("order4")
elseif request("order5")<>"" then
sql=sql&" order by card "&request("order5")
elseif request("order6")<>"" then
sql=sql&" order by jifen "&request("order6")
elseif request("order7")<>"" then
sql=sql&" order by id_zu "&request("order7")
else
sql=sql&" order by id desc"
end if
rs_huiyuan.open sql,conn,1,3
if not rs_huiyuan.eof then
rs_huiyuan.pagesize=maxrecord
rs_huiyuan.absolutepage=currentpage
for currentrec=1 to rs_huiyuan.pagesize
if rs_huiyuan.eof then
exit for
end if
%>
<tr onMouseOver="this.className='highlight'" onMouseOut="this.className=''" <%if request("form")<>"" then%>onDblClick="window.opener.document.<%=request.querystring("form")%>.<%=request.querystring("field")%>.value='<%=rs_huiyuan("id")%>';window.opener.document.<%=request.querystring("form")%>.<%=request.querystring("field2")%>.value='<%=rs_huiyuan("username")%>';window.opener.document.<%=request.querystring("form")%>.<%=request.querystring("field3")%>.value='<%=rs_huiyuan("card")%>';window.close();"<%else%>onDblClick="javascript:var win=window.open('gongzuo_show.asp?id=<%=rs_huiyuan("id")%>','档案详细信息','width=853,height=470,top=176,left=161,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no,scrollbars=yes'); win.focus()"<%end if%>>
<td align="center" height="25"><%=rs_huiyuan("card")%></td>
<td align="center"><%=rs_huiyuan("username")%></td>
<td align="center"><%if rs_huiyuan("tel")<>"" then%><%=rs_huiyuan("tel")%>
<%else%> <%end if%></td>
<td align="center">
<%if rs_huiyuan("enddate")-date()<0 then%>
<font color="#ff0000"><b><%=rs_huiyuan("startdate")%></b></font>
<%elseif rs_huiyuan("enddate")-date()<4 then%>
<font color="#009900"><b><%=rs_huiyuan("startdate")%></b></font>
<%else%>
<%=rs_huiyuan("startdate")%>
<%end if%>
</td>
<td align="center"><%if rs_huiyuan("enddate")-date()<0 then%>
<font color="#ff0000"><b><%=rs_huiyuan("enddate")%></b></font>
<%elseif rs_huiyuan("enddate")-date()<4 then%>
<font color="#009900"><b><%=rs_huiyuan("enddate")%></b></font>
<%else%>
<%=rs_huiyuan("enddate")%>
<%end if%></td>
<td align="center">
<%set rs_zu=conn.execute("select * from leib where id="&rs_huiyuan("id_zu"))%>
<%if rs_zu.eof then%>
<%else%>
<%=rs_zu("zu")%>
<%end if%>
</td>
<td align="center"><%=rs_huiyuan("login")%></td>
<%if fla37="1" or request.Cookies("shiwei_id")="1" then%>
<td align="center"><a href="gongzuo_modi.asp?form=<%=request("form")%>&field=<%=request("field")%>&field2=<%=request("field2")%>&field3=<%=request("field3")%>&id=<%=rs_huiyuan("id")%>&page=<%=currentpage%>&zu=<%=nowzu%>&keyword=<%=nowkeyword%>&order1=<%=request("order1")%>&order2=<%=request("order2")%>&order3=<%=request("order3")%>&order4=<%=request("order4")%>&order5=<%=request("order5")%>&order6=<%=request("order6")%>&order7=<%=request("order7")%>&order8=<%=request("order8")%>&order9=<%=request("order9")%>&order10=<%=request("order10")%>&order11=<%=request("order11")%>&order12=<%=request("order12")%>&order13=<%=request("order13")%>&order14=<%=request("order14")%>&order15=<%=request("order15")%>"><img src="../images/res.gif" border="0" hspace="2" align="absmiddle">修改</a></td>
<%end if%>
<%if fla38="1" or request.Cookies("shiwei_id")="1" then%>
<td align="center"><input type="checkbox" name="ID" value="<%=rs_huiyuan("id")%>" style="border:0"></td>
<%end if%>
<%if fla17="1" or request.Cookies("shiwei_id")="1" then%>
<%end if%>
</tr>
<%
rs_huiyuan.movenext
next
else
%>
<tr align="center" onMouseOver="this.className='highlight'" onMouseOut="this.className=''">
<td colspan="9" height="25" align="center" style="color:red"><b>没有找到记录</b></td>
</tr>
<%
end if
%>
<%
if rs_huiyuan.recordcount>0 then
%>
<tr>
<td colspan="9" height="30" class="category">
<table cellpadding=0 cellspacing=0 width="100%">
<tr>
<td align="left" style="color:#FF0000;"> <%if request("form")<>"" then%>
双击选择
<%else%>
双击可查看详细资料
<%end if%></td>
<td align="right">
<%=rs_huiyuan.recordcount%> 条信息 共 <%=rs_huiyuan.pagecount%> 页
<%
nowstart=currentpage-3
if nowstart<1 then
nowstart=1
end if
nowend=currentpage+3
if nowend>rs_huiyuan.pagecount then
nowend=rs_huiyuan.pagecount
end if
response.write " <a href='?form="&request("form")&"&field="&request("field")&"&field2="&request("field2")&"&field3="&request("field3")&"&zu="&nowzu&"&keyword="&nowkeyword&"&page=1&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"&order8="&request("order8")&"&order9="&request("order9")&"&order10="&request("order10")&"&order11="&request("order11")&"&order12="&request("order12")&"&order13="&request("order13")&"&order14="&request("order14")&"&order15="&request("order15")&"' class='page'>最前页</a> "
for ipage=nowstart to nowend
if cstr(ipage)=cstr(currentpage) then
response.write " <span style='font-weight:bold;color:#5858E6'>" & ipage &"</span> "
else
response.write " [ <a href='?form="&request("form")&"&field="&request("field")&"&field2="&request("field2")&"&field3="&request("field3")&"&zu="&nowzu&"&keyword="&nowkeyword&"&page="&ipage&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"&order8="&request("order8")&"&order9="&request("order9")&"&order10="&request("order10")&"&order11="&request("order11")&"&order12="&request("order12")&"&order13="&request("order13")&"&order14="&request("order14")&"&order15="&request("order15")&"' class='page'>" & ipage &"</a> ] "
end if
next
response.write " <a href='?form="&request("form")&"&field="&request("field")&"&field2="&request("field2")&"&field3="&request("field3")&"&zu="&nowzu&"&keyword="&nowkeyword&"&page="&rs_huiyuan.pagecount&"&order1="&request("order1")&"&order2="&request("order2")&"&order3="&request("order3")&"&order4="&request("order4")&"&order5="&request("order5")&"&order6="&request("order6")&"&order7="&request("order7")&"&order8="&request("order8")&"&order9="&request("order9")&"&order10="&request("order10")&"&order11="&request("order11")&"&order12="&request("order12")&"&order13="&request("order13")&"&order14="&request("order14")&"&order15="&request("order15")&"' class='page'>最后页</a> "
%>
<%if fla38="1" or request.Cookies("shiwei_id")="1" then%>
<input name="chkall" type="checkbox" id="chkall" value="select" onClick="CheckAll(this.form)" style="border:0"> 全选
<input type="submit" value="删 除" onClick="return confirm('此操作无法恢复!!!请慎重!!!\n\n确定要删除吗?')" class="button">
<%end if%>
</td>
</tr></table></td></tr>
<%end if%>
</table>
</form>
</td>
<td></td>
</tr>
<tr>
<td><img src="../images/r_4.gif" alt="" /></td>
<td></td>
<td><img src="../images/r_3.gif" alt="" /></td>
</tr>
</table>
</body>
</html>