不能翻页的错误总结:(1)可能是如上面(9)所示意的那样,查询按钮的名字不能和type相同,也为submit其中原代码如下:<input name="submit" type="submit" class="button" style="WIDTH: 80px" value="查询">我们应当改为:<input name="submit1" type="submit" class="button" style="WIDTH: 80px" value="查询">,不然会出现表单查询显示是点下一步,将继续向下一页翻页,但是点上一页,下一页,等都不可用。在上面(9)中,对此错误的查找做了较仔细的分析。(2)如果是排序,我们必须在Select后面加top 100 percent。,对这个问题的原因比较复杂,容我以后再说。    String strSql ="select top 100 percent HumanID,DictValue=(select DictValue from Basic01_Dict as b where b.dictid=a.TechID),UserType=(case UserType when '0' then '应聘' when '1' then '企业人才库' when '3' then '转入人员表' end ),";    strSql+=" Code,Name from interView03_NewHuman as a where   a.cropid="+session.getAttribute("cropid");  为了解决这个问题:我们将对应的Sql语句跟踪。strSql:select  HumanID,DictValue=(select DictValue from Basic01_Dict as b where b.dictid=a.TechID),UserType=(case UserType when '0' then '应聘' when '1' then '企业人才库' when '3' then '转入人员表' end ), Code,Name from interView03_NewHuman as a where   a.cropid=1 and  UserType='0'  order by usertype desc 我们首先跟踪程序:dg.ShowGrid():发现要执行:String num=conn.lookupfirst("select count(*) as cnum from ("+mSql+") as awqertc1q ","cnum");我们将上面的strSql带入到这里的mSql,在sqlserver查询器中执行,提示除非同时指定了TOP,否则order by子句在视图、派生表和子查询中无效。我们上网查找相关资料,发现是排序出现的实现小数据量和海量数据的通用分页显示存储过程出现的问题。这个问题比较复杂,对它的讨论,我们以后在说,这里我们只需要在Select后面加top 100 percent就可以了。(3)有时,我们可能可以翻页,但是,可能会出现对象值为空的错误提示,这是由于我们在body中调用了onlad,如这里<body onload="Change_Select(1)">,每次onload一次,都会对Change_Select(1)里面的值产生影响,我们必须保证任何时候都要对空值进行处理. 如这里我们需要对KeyDepart的值取“Pselect”时进行处理(targetKeyDepart.equals("Pselect")==true。): if( targetKeyDepart.equals("")==true || targetFlag.equals("0")==true ||targetKeyDepart.equals("Pselect")==true){                          xml+= "<select><value>Pselect</value><text>全部</text></select>" ;                     }如果没有进行处理,将显示,<select><value>Pselect</value><text> </text></select>,其中的text为空值。其中对应的Select为公司-部门-处室三级下拉框的组件的值。     <td width="40" height="26" align="right" nowrap> 公司:</td>     <td width="110" align="left"><select style="width:100 " name="Corp" id="Corp"  onChange="Change_Select(0)" ></select></td>    <td width="40" align="right" nowrap>部门:</td>     <td width="110" align="left"><select style="width:110 " name="Depart" id="Depart" onChange="Change_Select2()"></select></td>     <td width="40" align="right" nowrap>处室:</td>    <td width="110" align="left"><select style="width:110 " name="Chu" id="Chu"></select></td>