1. 论坛系统升级为Xenforo,欢迎大家测试!
    排除公告

ASP判断问题!!!

本帖由 阿达2007-05-02 发布。版面名称:后端开发

  1. 阿达

    阿达 New Member

    注册:
    2005-12-06
    帖子:
    54
    赞:
    0
    点到分页的最后一页出现

    ADODB.Field 错误 '80020009'

    BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。


    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <% if Request.QueryString("d")="add" then %>
    <!--#include file="conn.asp"-->
    <%
    if Request.QueryString("xs_nj")="" or Request.QueryString("xs_zy")="" or Request.QueryString("xs_bj")="" then
    response.write "<script language=javascript>"
    response.write "alert('^_^请详细填写查询资料!^_^');"
    response.write "javascript:history.go(-1);"
    response.write "</script>"
    else
    xs_nj=Request.QueryString("xs_nj")
    xs_zy=Request.QueryString("xs_zy")
    xs_bj=Request.QueryString("xs_bj")
    set rs=server.createobject("adodb.recordset")
    sql="select * from xsqk where xs_nj='"&xs_nj&"'and xs_zy = '"&xs_zy&"' and xs_bj = '"&xs_bj&"'"
    rs.open sql,conn,1,1
    %>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>梅州市技工學校信息化管理系統</title>
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    <style type="text/css">
    <!--
    .bq {font-size:16px;
    line-height: 140%;
    }
    .STYLE7 {
    font-size: 18px;
    font-weight: bold;
    }
    .STYLE10 {font-size: 16px;}
    -->
    </style>
    </head>
    <body>
    <%
    if not rs.recordcount>0 then
    %>

    <div align="center"><p>&nbsp;</p><b>对不起,没有找到你想要的记录!<b><p></p><a href="index.asp">首页</a>&nbsp;&nbsp;<a href="xsqkcx.asp">继续查询</a></div>
    <%
    else
    %>
    <div align="center"><span class="STYLE7">梅州市技工学校&nbsp;<%=rs("xs_nj")%>&nbsp;<%=rs("xs_zy")%>&nbsp;<%=rs("xs_bj")%>&nbsp;学生基本情况查询结果</span>
    <br /><a href="index.asp">首页</a>&nbsp;&nbsp;<a href="xsqkcx.asp">继续查询</a>
    <br />页面:
    <%
    xs_nj=Request.QueryString("xs_nj")
    xs_zy=Request.QueryString("xs_zy")
    xs_bj=Request.QueryString("xs_bj")
    dim page
    page=Clng(request("page"))
    rs.pagesize=1
    if page<1 then page=1
    if page>rs.pagecount then page=rs.pagecount
    rs.Absolutepage=page
    %>

    <table aling="center" border="1" width="841" cellpadding="2" cellspacing="0">
    <tr align="center"><td><span class="STYLE10">姓名</span></td>
    <td><span class="STYLE10">学号</span></td>
    <td><span class="STYLE10">性别</span></td>
    <td><span class="STYLE10">年龄</span></td>
    <td><span class="STYLE10">民族</span></td>
    <td><span class="STYLE10">入学时间</span></td>
    <td><span class="STYLE10">毕业时间</span></td>
    </tr>
    <%
    for i=1 to rs.pagesize
    %>
    <tr align="center"><td><%=rs("xs_user") %>&nbsp;</td><td><%=rs("xs_xh") %>&nbsp;</td><td><%=rs("xs_xb")%>&nbsp;</td><td><%=rs("xs_nl") %>&nbsp;</td><td><%=rs("xs_nz")%>&nbsp;</td><td><%=rs("xs_lxtime")%>&nbsp;</td><td><%=rs("xs_bytime")%>&nbsp;</td>
    </tr>
    <%
    rs.movenext
    if rs.eof then
    exit for
    end if
    next
    %>
    </table><% end if %>
    <%
    if page<>1 then %>
    <a href=xsqkcx.asp?d=add&xs_nj=<%=rs("xs_nj")%>&xs_zy=<%=rs("xs_zy")%>&xs_bj=<%=rs("xs_bj")%>&page=1>首页</a>
    <a href=xsqkcx.asp?d=add&xs_nj=<%=rs("xs_nj")%>&xs_zy=<%=rs("xs_zy")%>&xs_bj=<%=rs("xs_bj")%>&page=<%=(page-1)%>>上一页</a>
    <%end if
    if page<>rs.pagecount then %>
    <a href=xsqkcx.asp?d=add&xs_nj=<%=rs("xs_nj")%>&xs_zy=<%=rs("xs_zy")%>&xs_bj=<%=rs("xs_bj")%>&page=<%=(page+1)%>>下一页</a>
    <a href=xsqkcx.asp?d=add&xs_nj=<%=rs("xs_nj")%>&xs_zy=<%=rs("xs_zy")%>&xs_bj=<%=rs("xs_bj")%>&page=<%=rs.pagecount%>>尾页</a>
    <%
    end if
    %>
    第<%=page%>页/共有<%=rs.pagecount%>页

    </div>
    </body>
    <%
    rs.close
    set rs=nothing
    conn.close
    set rs=nothing
    end if
    %></html>
    <%else%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>梅州市技工學校信息化管理系統</title>
    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
    <style type="text/css">
    <!--
    .STYLE2 {color: #FFFFFF}
    .STYLE6 {font-size: 14px}
    .bq {font-size:16px;
    line-height: 140%;
    }
    A:link{color:#ffffff;text-decoration:none}
    A:visited{color:#ffffff;text-decoration:none}
    A:active{color:#ff0000;text-decoration:none}
    A:hover{color:#ff0000;text-decoration:none}
    .STYLE12 {color: #FF0000}
    -->
    </style>
    </head>
    <!-- #include file="top1.inc" -->
    <!-- 导航条 -->
    <tbody>
    <tr>
    <td >
    <table width="778" bgcolor="#0089f7"height="30" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="100%">&nbsp;<span class="STYLE2"><img src="images/class_ar.gif">&nbsp;<span style="font-weight: bold">您当前的位置: <a href="index.asp">首页</a></span></span> <span class="STYLE2" style="font-weight: bold; color: #FFFFFF">-&gt;</span> <span class="STYLE2" style="font-weight: bold; color: #FFFFFF">学生基本情况查询</span></td>
    </tr></table></td></tr></tbody>

    <!-- BODY内客 1 -->
    <tbody>
    <div>&nbsp;<br/><tr><td><table width="358" border="1" align="center" cellpadding="0" cellspacing="2" bordercolor="#c4d6c4" bgcolor="#ffffff">
    <tr>
    <td width="358" height="26" colspan="2" background="images/main_bs.gif"><div align="center" style="font-size: 24px">
    <p class="STYLE2" style="font-weight: bold">学生基本情况查询</p>
    </div></td></tr>
    <tr>
    <td colspan="2" align="right">请注意:带有<span class="STYLE12">*</span>的项目必须填写。</td></tr>
    <form action="xsqkcx.asp?d=add" method="get">
    <input name="d" value="add" type="hidden">
    <tr><td width="25%" align="right">学生年级:&nbsp;</td><td><input type="text" name="xs_nj" size="12" />&nbsp;<span class="STYLE12">*</span></td></tr>
    <tr><td width="25%" align="right">学生专业:&nbsp;</td><td><input type="text" name="xs_zy" size="12" />&nbsp;<span class="STYLE12">*</span></td></tr>
    <tr><td width="25%" align="right">学生班级:&nbsp;</td><td><input type="text" name="xs_bj" size="12" />&nbsp;<span class="STYLE12">*</span></td></tr>
    <tr><td colspan="2" align="center"><input type="submit" value="查询">&nbsp;&nbsp;<input type="reset" value="重置"></td></tr>
    </form>
    </table>
    <div>&nbsp;<br/><br/></div></td></tr></tbody>
    <!-- #include file="eof.inc" -->
    <%end if%>
    请问要如果判断,才不会出错