分頁程式出現錯誤???急!!!

reedchen 2003-12-13 05:21:13
我做分頁程式經常出現錯誤.如下;
ADODB.Recordset (0x800A0CB3)
Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.
請教高手指點,謝謝先
...全文
18 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
troopers 2003-12-15
  • 打赏
  • 举报
回复
我和你一样的问题啊。你不要用recordcount等属性了。我上面的那个代码你看看。可以解决问题的
reedchen 2003-12-15
  • 打赏
  • 举报
回复
我用的是加1,3但在MYSQL中不行,在Oracle中可以,現在又碰到一個問題,如果我在查詢一個table可以分頁,但如果查詢兩個table,並在網頁上顯示兩個table中的部分資料,分頁就不行,只顯示第一頁,而且顯示總的記錄數和總頁數都為-1,請問哪位高手可以幫忙指點,謝謝先;
Set Conne = Server.CreateObject("ADODB.Connection")
conne.open "Driver={Microsoft ODBC For Oracle};server=dnisfis; uid=sfis; pwd=sfis"
Set RS=Server.CreateObject("ADODB.RecordSet")
sql= "select C.EMP,P.EMP_PASS,C.FUN,C.PRIVILEGE,C.PRG_NAME,P.EMP_NAME FROM SFIS1.C_PRIVILEGE C, SFIS1.C_EMP_DESC_T P WHERE C.EMP=P.EMP_NO order by C.EMP desc"
troopers 2003-12-15
  • 打赏
  • 举报
回复
我以前用的sqlserver数据库分页没问题。里面的各种属性多支持。后来用sybase数据库就有问题了。因为里面也有好多的属性不支持。我给你看看我的代码。不是用asp里面的记录集等属性实现的。希望能给你帮助
<!--#INCLUDE FILE="data.asp" -->
<!--#INCLUDE FILE="check.asp" -->
<script>
function OpenWindows(url)
{
var
newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=50,left=120,width=600,height=400");
return false;

}
function OpenSmallWindows(url)
{
var
newwin=window.open(url,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,top=50,left=120,width=600,height=370");
return false;

}
</script>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="oa.css">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" bgcolor="#FFFFFF" onLoad="MM_preloadImages('images/add_on.gif')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="heading" bgcolor="#4e5960" colspan="2" height="3"></td>
</tr>
<tr>
<td class="heading" bgcolor="#4e5960" colspan="2"> <font color="#FFFFFF"><b>日程安排</b></font></td>
</tr>

<td width="100%" bgcolor="#BFBFBF">
<table width="100%" border="0" cellspacing="1" cellpadding="2" bgcolor="#FFFFFF">
<tr bgcolor="#999999">
<td colspan="5" align="right">

<table border=0 width=100% bgcolor="#999999" cellpadding="0" cellspacing="0">
<tr>
<td width="2%" align="right"><img src="images/adorn.gif" width="10" height="18"></td>
<td width=65><a href="addcalendar.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image1','','images/add_on.gif',1)" onClick="return OpenSmallWindows(this.href);"><img name="Image1" border="0" src="images/add_off.gif"></a></td>
<td><%

dim page
page=request("page")
if page=0 then
page=1
end if
PageSize = 5
dim rs,strSQL,news
strSQL ="SELECT * FROM asp_calendar where userid="&session("Uid")&" ORDER BY id DESC"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSQL,Conn,3,3


if rs.eof then
response.write "<font class='3dfont'>还没有任何东东</font>"
else
'/////////////////////////////求出总记录数
sSql = "select Count(*) from asp_calendar where userid="&session("Uid")&" ORDER BY id DESC"

set MeetingSet = Server.CreateObject("ADODB.Recordset")
Set MeetingSet.ActiveConnection = Conn

MeetingSet.Open sSql
Max=int(MeetingSet(0))
'/////////求记录数结束max返回记录数
%> <table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr> <form method=Post action=""><FONT COLOR="#ffffff">
[<b><%=page%></b>/<%=-int(-Max/PageSize)%>页] [共<%=Max%>个] <font size=2>

<% '//////////////////////分页实现

if Cint(Page)<=0 then
Page=1
end if

dim destpage
if Cint(Page)>1 then
destpage=Cint(Page)-1
Response.Write " <a href='?page="& destpage & "' >前一页</a>"
end if

if Cint(Page)< -int(-Max/PageSize) then
destpage=Cint(Page)+1
Response.Write " <a href='?page="& destpage&"' >后一页 </a>"
end if
'/////////////分页实现结束
%>
</font> <input type='text' name='page' size=2 maxlength=10 style="font-size:9pt;color:#FFFFFF;background-color:#666666;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000" value="<%=page%>" align=center> <input style="border:1 solid black;FONT-SIZE: 9pt; FONT-STYLE: normal; FONT-VARIANT: normal; FONT-WEIGHT: normal; HEIGHT: 18px; LINE-HEIGHT: normal" type='submit' value=' Goto ' size=2></td>
</tr>
</table></td>

<td width="3%"><img src="images/adorn.gif" width="10" height="18"></td>
</tr>
</table>
<TR bgcolor="#bfbfbf" align=center>
<TD width=450 ><b>日程名称</b></TD>

<TD width=120> <b>活动时间</b> </TD>

<TD width=50> <b>状态</b> </TD>
</TR>
<%
'///////////显示每页的记录
count=0
For i = 1 to (Page-1)*PageSize
rs.MoveNext
next
if not rs.eof then
For i = 1 to pagesize

%>

<TR bgcolor="#efefef">
<TD><a href="modCalendar.asp?Id=<%=rs("id")%>" onclick="return OpenSmallWindows(this.href);" ><%=rs("title")%></a></TD>
<%onclick="return OpenSmallWindows(this.href);"%>
<TD><%=left(rs("addtime"),1)%>/<%=mid(rs("addtime"),5,2)%>/<%=mid(rs("addtime"),7,2)%>  <%=mid(rs("addtime"),9,2)%>:<%=right(rs("addtime"),2)%></TD>

<TD><%if rs("state")=0 then%><font color=red>未提醒</font><%else%>已提醒<%end if%></TD>
</TR>
<%
rs.MOVENEXT
if rs.EOF then Exit For

Next

end if
end if%>

</TABLE>
</td>
</tr>
</table>

</body>
</html>
龙神羲皇 2003-12-15
  • 打赏
  • 举报
回复
最好加1,3
reedchen 2003-12-15
  • 打赏
  • 举报
回复
我的數據庫是MYSQL類型,有些方法PAGECOUNT,ABSOLUTEPAGE好像不支持,請問如何可以達到相同的效果呢
gjdbf 2003-12-14
  • 打赏
  • 举报
回复
讲得很明白了,当前数据库驱动不支持书签,还是改用别的方法实现分页吧
ask999 2003-12-14
  • 打赏
  • 举报
回复
你把源程序贴出来!
anddytang 2003-12-13
  • 打赏
  • 举报
回复
你把源程序贴出来!
oldmht 2003-12-13
  • 打赏
  • 举报
回复
open 的时候后面加的什么参数阿
rs.open "...",conn,1,1行不行

28,391

社区成员

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

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