麻烦各位,初级分页问题出现0x80020009错误,我也找不到错误
错误类型:
ADODB.Field (0x80020009)
BOF 或 EOF 中有一个是“真”,或者当前的记录已被删除,所需的操作要求一个当前的记录。
<%
pgsize=16
Set conn=server.CreateObject("adodb.connection")
conn.open "Provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db2.mdb")
Set rs1=server.CreateObject("adodb.recordset")
rs1.open "select UserRegName,RegNickName,UserAddTime from UserInfo order by UserRegID asc",conn,3,1,1
rs1.PageSize=pgsize
int_totalrecord=rs1.RecordCount
If int_totalrecord Mod pgsize = 0 Then
intpagecount=CInt(int_totalrecord / pgsize)
Else
intpagecount=CInt((int_totalrecord / pgsize)+1)
End If
intpage=request.querystring("intpage")
If RegExpTest("^([1-9]+)([0-9]*)$",intpage)<>True Then intpage=1
If intpage>intpagecount Then intpage=intpagecount
rs1.AbsolutePage=intpage
Function RegExpTest(patrn, strng)
Dim regEx, retVal
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = False
retVal = regEx.Test(strng)
RegExpTest = retVal '不符合false,符合为true
End Function
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
</head>
<body>
<table>
<%
If rs1.eof And rs1.bof Then
response.write "无信息"
Else
For iloop=1 To pgsize
%>
<tr><td><%=rs1("UserRegName")%></td><td><%=rs1("RegNickName")%></td><td><%=rs1("UserAddTime")%></td></tr>
<%
rs1.MoveNext
Next
End If%>
</table>
<table border="1" cellpadding="1" cellspacing="0" bordercolordark="#000000" bordercolorlight="#FFFFFF">
<tr>
<td><%For dloop=1 To intpagecount%> <a href="?intpage=<%=dloop%>"><%=dloop%></a> <%Next%></td>
</tr>
</table></body>
</html>
<%
rs1.close
Set rs1=Nothing
Set conn=Nothing
%>