类型不匹配
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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>分页显示记录</title>
</head>
<body>
<%
dim cnn,rst,sSQL,currentPage,rowCount,i
currentPage=request.QueryString("currentPage")
if currentPage="" then
currentPage=1
end if
set conn=server.CreateObject("adodb.connection")
set rst=server.CreateObject("adodb.recordset")
conn.open"dbq="&server.MapPath("mydatabase.mdb")&";driver={Microsoft Access Driver (*.mdb)}"
rst.cursortype=3
rst.pagesize=5
sSQL="select * from Products"
rst.open sSQL,conn
rst.absolutepage=currentPage
rowCout=0
%>
<table border="1">
<caption>作者情况一览表</caption>
<tr>
<% for i=0 to rst.fields.count-1 %>
<th><% =rst(i).name %></th>
<% next %>
</tr>
<% while not rst.eof and rowCout<rst.pagesize %>
<tr>
<% for i=0 to rst.fields.count-1 %>
<td><% =rst(i) %></td>
<% next %>
</tr>
<%
rowCount=rowCount+1
rst.movenext
wend
%>
</table>
<p>共<% =rst.pagecount %>页 当前页次:<% =currentPage %>/<% =rst.pagecount %> 分布:
<%
for i=1 to rst.pagecount
if i=cint(currentPage) then
%>
[<font color="red"><% =i %></font>]
<% else %>
[<a href=fy.asp?currentPage=<% =i %>"><% =i %></a>]
<%
end if
next
%>
</p>
</body>
</html>
运行首页(第一页)没错,但点其它页出现以下错误:
技术信息(用于支持人员)
错误类型:
Provider (0x80020005)
类型不匹配。
/test/fy.asp, 第 22 行
浏览器类型:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
网页:
GET /test/fy.asp
时间:
2006年10月2日, 下午 02:46:41
详细信息:
Microsoft 支持
请大侠们帮帮忙。
问题点数:10、回复次数:3Top
1 楼hanpoyangtitan(韩波洋)回复于 2006-10-02 17:20:41 得分 0
products是不是写错了?Top
2 楼cceon(披着狼皮的黄鼠狼)回复于 2006-10-02 19:01:48 得分 0
currentPage=cint(request.QueryString("currentPage"))Top
3 楼shwns()回复于 2006-10-03 08:53:57 得分 0
我试过了还是不行。
请高手们帮帮忙。Top




