分页显示的问题???(在先等)

wmlf 2003-09-13 03:14:11
我的代码为两个文件,
报搓为:
ADODB.Recordset 错误 '800a0bb9'
变量或者类型不正确,或者不在可以接受的范围之内,要不就是与其他数据冲突。

/admin/web14/OnePage.asp,行10


<% labguage="vbscript" %>
<!--#include file="OnePage.asp" -->
<%
sub opendata(conn) '连接数据库
set conn=server.createobject("adodb.connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.Mappath("/date/netbg.mdb")
end sub
dim myrs '打开记录集
Set myrs = Server.CreateObject("ADODB.Recordset")
myrs.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.Mappath("/date/netbg.mdb")
myrs.Source = "select * from zsxm order by zsxmid "
'desc
'myrs.CumyrsorType = 3
'myrs.CumyrsorLocation = 2
myrs.LockType = 3
myrs.Open()
%>
<script language="JavaScript" type="text/JavaScript">

function MM_popupMsg(msg)
{ //v1.0
alert(msg);
}
</script>
<html>
<head>
<title>招商项目</title>
</head>
<body bgcolor="beige">
<h2 ALIGN="CENTER">中国鄂州招商项目一览表</h2>
<hr>
<%
myrs.PageSize = 10
Page =CLng(Request("Page"))
If (Page < 1) Then Page = 1
If Page > myrs.PageCount Then Page = myrs.PageCount
ShowOnePage rs, Page
%>
<div ALIGN="right">
<hr>
<form Action="1.asp" Method="GET">
<%
If (Page <> 1) Then
Response.Write "<A HREF=1.asp?Page=1>第一页</A>"
Response.Write "<A HREF=1.asp?Page=" & (Page-1) & ">上一页</A>"
End If
If Page <> myrs.PageCount Then
Response.Write "<A HREF=1.asp?Page=" & (Page+1) & ">下一页</A>"
Response.Write "<A HREF=1.asp?Page=" & myrs.PageCount & ">最后一页</A>"
End If
%>
<p>输入页数:<input TYPE="TEXT" Name="Page" SIZE="3"> 页数:<font COLOR="Red"><%=Page%>/<%=myrs.PageCount%></font>
</p>
</form>
</div>
<%
myrs.Close()
Set myrs = Nothing
%>
</body>
</html>

<% labguage="vbscript" %>
<%
Sub ShowOnePage( rs, Page )
Response.Write "<CENTER><table border=4 bordercolor=orange>"
Response.Write "<TR bgcolor=orange>"
Response.WRITE "<TD align=center><font color=white ><b>招商项目ID</b></font></TD>"
Response.WRITE "<TD align=center><font color=white ><b>招商项目名称</b></font></TD>"
Response.WRITE "<TD align=center><font color=white ><b>删除</b></font></TD>"
Response.Write "</TR>"
myrs.AbsolutePage=Page
For iPage = 1 To myrs.PageSize
Response.Write "<TR align=middle>"
RecNo = (Page - 1) * myrs.PageSize + iPage
While (NOT myrs.EOF)
%>
<tr>
<td align="default" width="25%">
<div align="center"> <%=(myrs.Fields.Item("zsxmid").Value)%></a> </div></td>
<td align="default" width="25%">
<div align="center"><%=(myrs.Fields.Item("zsxmmc").Value)%> </div></td>
<td align="default" width="25%">
<div align="center">
<input type="checkbox" name="delit" value="<%=(myrs.Fields.Item("zsxmid").Value)%>">
</div></td>
</tr>
<%
myrs.MoveNext()
Wend
'If myrs.EOF Then Exit For
next
Response.Write "</TABLE></CENTER>"
End Sub
%>
报搓为:
ADODB.Recordset 错误 '800a0bb9'
变量或者类型不正确,或者不在可以接受的范围之内,要不就是与其他数据冲突。

/admin/web14/OnePage.asp,行10
...全文
59 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
wang7655 2003-09-14
  • 打赏
  • 举报
回复
对啊!

需要自己仔细检查的
IamScout 2003-09-14
  • 打赏
  • 举报
回复
把你的showonepage放到上面好不好,另你language都拼错了。一步一步排查。
dishui 2003-09-14
  • 打赏
  • 举报
回复
打开记录集时:myrs.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="& Server.Mappath("/date/netbg.mdb")
需要吗??
总觉得 用错了
海牛 2003-09-14
  • 打赏
  • 举报
回复
问题解决了给点分好吗?
海牛 2003-09-14
  • 打赏
  • 举报
回复
看清楚了,数据库连接应该这样打开:
Set conn=CreateObject("Adodb.Connection")
Set myrs=CreateObject("Adodb.Recordset")
myrs.ActiveConnection=conn
myrs.CursorLocation=3
myrs.Open "select * from zsxm order by zsxmid ",,,,&H0001
·
·
·
wmlf 2003-09-13
  • 打赏
  • 举报
回复
根本就不是这的问题。。
高手在那???
yangsm 2003-09-13
  • 打赏
  • 举报
回复
Server.Mappath("/date/netbg.mdb")
换为
Server.Mappath("date/netbg.mdb")
来试试。
wmlf 2003-09-13
  • 打赏
  • 举报
回复
myrs.AbsolutePage=Page
这个地方总是说有问题。
可是我还有一个以前做的是没有问题的。。
帮帮忙,我晕了,,,
高手在那???

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧