当前位置: 代码迷 >> ASP >> 下一页中ADODB.Field 异常 '80020009'
  详细解决方案

下一页中ADODB.Field 异常 '80020009'

热度:924   发布时间:2012-02-04 15:43:09.0
下一页中ADODB.Field 错误 '80020009'
<!--   #include   file= "ChkPwd.asp "   -->
<html>
<head>
<title> 部门人员信息浏览 </title>
</head>
<body>
----------根据另一个ASP传入的 "deptno "动态显示标题----------
<%

Dno=Request.QueryString( "deptno ")
set   Conn=Server.CreateObject( "ADODB.Connection ")
Conn.ConnectionString= "driver={SQL   Server};server=SEEKY;UID=sa;PWD=5214087376;Database=studentDB "
Conn.Open
        sql= "select   *   from   DeptList   where   DeptNo= ' "&Dno& " ' "
Set   rs=Server.CreateObject( "ADODB.Recordset ")
rs.open   sql,Conn,1,3
%>

----------------分页设置--------------------

<h3   align= "center "> <%=rs( "DeptName ")%> 部门人员信息浏览 </h3>
<hr   color= "#999999 "   />
<h2   align= "center "> 分页显示表员工的记录 </h2>
<%

Set   rs1=Server.CreateObject( "ADODB.Recordset ")
Set   rs1.ActiveConnection   =   Conn
rs1.CursorType   =   3
rs1.open   "SELECT   *   WHERE   DeptNo= ' "&Dno& " ' "  
                  rs1.PageSize   =   5
                  page   =   CLng(Request.QueryString( "page "))
                  if     rs1.RecordCount   >   0   then
                  If   page   <   1   Then
                              page   =   1
                  end   if
                  if   page   >   rs1.PageCount   Then
                              page   =   rs1.PageCount
                  End   If    
                  rs1.AbsolutePage   =   page
   
%>

------------显示记录,每5个记录一页----------------
<BR>     当前页码: <%=page%> / <%=rs1.PageCount%>
<BR>    
<table   width= '90% '   align=center   cellspacing=1   cellpadding=2   border=1   bordercolor= "#808080 "   bordercolordark= "#FFFFFF "   bordercolorlight= "#E1F5FF ">
<tr>
<td   align= "center "     bgcolor= "#E1F5FF "> <b> 序号 </b> </td>
<td   align= "center "     bgcolor= "#E1F5FF "> <b> 员工编号 </b> </td>
<td   align= "center "     bgcolor= "#E1F5FF "> <b> 姓名 </b> </td>
<td   align= "center "     bgcolor= "#E1F5FF "> <b> 性别 </b> </td>
<td   align= "center "     bgcolor= "#E1F5FF "> <b> 年级 </b> </td>
<td   align= "center "     bgcolor= "#E1F5FF "> <b> 专业 </b> </td>
  相关解决方案