请问那位兄弟真正的试过,用ASP连接ORACLE后,是不是RECORDCOUNT,PAGECOUNT的属性都没有了 在ASP中提问,也许是别人认为很简单,没有什么回答,可我弄了几天了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 adodb.recordset记录集的reccount有时是无效的。最好的是用sql="select count(*) as recoun from yourtable"或者记录集循环得到记录数 Rs.Open SQL,cn,1,3改成Rs.Open SQL,cn,3,3试一下 <%set rs1 = Server.CreateObject("ADODB.Recordset")rs1.ActiveConnection = MM_conn_STRINGrs1.Source = "SELECT TITLENO, TITLE, CURRENTTIME, USERNAMENO, USERNAME, FORUMNO, STATS, NUM, TIMES, LASTMAN, LASTDATE, LASTNO FROM ZDWY.MESSAGE WHERE FORUMNO = '"&Request("FORUMNO")&"' ORDER BY LASTDATE DESC"rs1.CursorType = 0rs1.CursorLocation = 3rs1.LockType = 3rs1.Open()%><% sub showpage(rs1,pageno) rs1.absolutepage=pageno for n=1 to rs1.pagesize response.write "<tr>" response.write "<TD align=middle width=30 ><A href='javascript:O1(62)'><IMG src='images/locktop.gif' width=15 border=0 height='15'></A></TD>" response.write "<TD align=left width='369'> <A href='javascript:O2(62)'><IMG height=13 src='images/04.gif' width=13" response.write "align=absMiddle border=0></A> <SPAN id=forum>" response.write "<A title="&rs1("title")&"nbsp; 发布时间:"&rs1("currenttime")&"nbsp; href='title.asp?forumno="&request("forumno")&"&forumname="&request("forumname")&"&titleno="&rs1("titleno")&"'>"&rs1("title")&"</A> </SPAN></TD>" response.write "<TD align=middle width=78 >" response.write "<A href='data.asp?usernameno="&rs1("usernameno")&"'>"&rs1("username")&"</A></TD>" response.write "<TD align=middle width=30 ><FONT color=#333333>"&rs1("num")&"</FONT></TD>" response.write "<TD align=middle width=30 ><FONT color=#333333>"&rs1("times")&"</FONT></TD>" response.write "<TD align=middle width=120 >" if isnull(rs1("lastdate")) then response.write rs1("currenttime") else response.write rs1("lastdate") end if response.write "</TD>" response.write "<TD width=68 >" if isnull(rs1("lastman")) then response.write "......" else response.write "<A href='data.asp?usernameno="&rs1("lastno")&"'>"&rs1("lastman")&"</a>" end if response.write "</TD></TR>" rs1.movenext() if rs1.eof then exit for next end sub%><TABLE borderColor=#F2FBF1 cellSpacing=0 width=755 border=1> <TBODY> <% rs1.PageSize=20 pageno=clng(request("pageno")) if pageno<1 then pageno=1 if pageno>rs1.pagecount then pageno=rs1.pagecount showpage rs1,pageno %> </TBODY> </TABLE> rs1.CursorLocation = 3这句比较重要分页,记录数也可统计出来的还有问题吗? 的确这样asp中,对oracle是很奇怪的,可能是oracle不支持rs.RECORDCOUNT无效rs.PAGECOUNT有效所以可以通过count(*)取得总记录数,代替rs.RECORDCOUNT set CursorLocation to Local then you can use recordcount. otherwise it doesn't work. 关于左连接,右连接的使用 ora-01113,ora-01110错误,请帮忙看下,谢谢 寻求sql 导入另一台电脑的.txt文件数据到本地oracle数据库 ECLIPSE的图片显示问题 牛人指点一下新人oracle基础的东西 linux下oracle环境变量的含义 在sqlplus里显示更新成功,但是实际上却并没有更新 安装OracleHome92(客户端)时出现错误:"数据库无法加载". Oracle9i 可以在PC上运行吗? 如何把Oracle中Select出来的数据保存成mdb或文本文件(挥泪大送分) 求助高手,急急急!!关于Oracle的问题!
最好的是用sql="select count(*) as recoun from yourtable"
或者记录集循环得到记录数
改成
Rs.Open SQL,cn,3,3
试一下
set rs1 = Server.CreateObject("ADODB.Recordset")
rs1.ActiveConnection = MM_conn_STRING
rs1.Source = "SELECT TITLENO, TITLE, CURRENTTIME, USERNAMENO, USERNAME, FORUMNO, STATS, NUM, TIMES, LASTMAN, LASTDATE, LASTNO FROM ZDWY.MESSAGE WHERE FORUMNO = '"&Request("FORUMNO")&"' ORDER BY LASTDATE DESC"
rs1.CursorType = 0
rs1.CursorLocation = 3
rs1.LockType = 3
rs1.Open()
%>
<%
sub showpage(rs1,pageno)
rs1.absolutepage=pageno
for n=1 to rs1.pagesize
response.write "<tr>"
response.write "<TD align=middle width=30 ><A href='javascript:O1(62)'><IMG src='images/locktop.gif' width=15 border=0 height='15'></A></TD>"
response.write "<TD align=left width='369'> <A href='javascript:O2(62)'><IMG height=13 src='images/04.gif' width=13"
response.write "align=absMiddle border=0></A> <SPAN id=forum>"
response.write "<A title="&rs1("title")&"nbsp; 发布时间:"&rs1("currenttime")&"nbsp; href='title.asp?forumno="&request("forumno")&"&forumname="&request("forumname")&"&titleno="&rs1("titleno")&"'>"&rs1("title")&"</A> </SPAN></TD>"
response.write "<TD align=middle width=78 >"
response.write "<A href='data.asp?usernameno="&rs1("usernameno")&"'>"&rs1("username")&"</A></TD>"
response.write "<TD align=middle width=30 ><FONT color=#333333>"&rs1("num")&"</FONT></TD>"
response.write "<TD align=middle width=30 ><FONT color=#333333>"&rs1("times")&"</FONT></TD>"
response.write "<TD align=middle width=120 >"
if isnull(rs1("lastdate")) then
response.write rs1("currenttime")
else
response.write rs1("lastdate")
end if
response.write "</TD>"
response.write "<TD width=68 >"
if isnull(rs1("lastman")) then
response.write "......"
else
response.write "<A href='data.asp?usernameno="&rs1("lastno")&"'>"&rs1("lastman")&"</a>"
end if
response.write "</TD></TR>"
rs1.movenext()
if rs1.eof then exit for
next
end sub
%>
<TABLE borderColor=#F2FBF1 cellSpacing=0 width=755 border=1>
<TBODY>
<%
rs1.PageSize=20
pageno=clng(request("pageno"))
if pageno<1 then pageno=1
if pageno>rs1.pagecount then pageno=rs1.pagecount
showpage rs1,pageno
%>
</TBODY>
</TABLE>
这句比较重要分页,记录数也可统计出来的还有问题吗?
asp中,对oracle是很奇怪的,可能是oracle不支持
rs.RECORDCOUNT无效
rs.PAGECOUNT有效
所以可以通过count(*)取得总记录数,代替rs.RECORDCOUNT