asp+sqlserver的执行存储过程分页问题
我在用set rs=conn.execute(存储过程语句)执行后因为关系到执行存储过程将存储过程的结果分页问题
但是却发现rs.pagecount与rs.recordset的值都为-1
而且本来在执行了存储过程语句后纪录是12 但是在asp程序中执行后rs.pagesize=10
请问各位高手这个问题怎么解决呀
我该如何将存储过程的结果进行分页呢
问题点数:20、回复次数:3Top
1 楼wgsasd311(自强不息)回复于 2005-08-24 10:23:52 得分 15
把你的存储过程贴出来。Top
2 楼jiedushi(东杰)回复于 2005-08-25 09:11:29 得分 0
我的数据库是记录ip的表名称为ip结构为
id ip date
存储过程是将其中的ip地址按每天24小时统计个数
内容为
CREATE PROCEDURE ipcount
AS
declare @str varchar(8000)
select 日期=convert(varchar(10), mdate, 120)
,[0]=sum(case
when datepart(hh, mdate)>=0 and datepart(hh, mdate)<1 then 1 else 0 end)
,[1]=sum(case
when datepart(hh, mdate)>=1 and datepart(hh, mdate)<2 then 1 else 0 end)
,[2]=sum(case
when datepart(hh, mdate)>=2 and datepart(hh, mdate)<3 then 1 else 0 end)
,[3]=sum(case
when datepart(hh, mdate)>=3 and datepart(hh, mdate)<4 then 1 else 0 end)
,[4]=sum(case
when datepart(hh, mdate)>=4 and datepart(hh, mdate)<5 then 1 else 0 end)
,[5]=sum(case
when datepart(hh, mdate)>=5 and datepart(hh, mdate)<6 then 1 else 0 end)
,[6]=sum(case
when datepart(hh, mdate)>=6 and datepart(hh, mdate)<7 then 1 else 0 end)
,[7]=sum(case
when datepart(hh, mdate)>=7 and datepart(hh, mdate)<8 then 1 else 0 end)
,[8]=sum(case
when datepart(hh, mdate)>=8 and datepart(hh, mdate)<9 then 1 else 0 end)
,[9]=sum(case
when datepart(hh, mdate)>=9 and datepart(hh, mdate)<10 then 1 else 0 end)
,[10]=sum(case
when datepart(hh, mdate)>=10 and datepart(hh, mdate)<11 then 1 else 0 end)
,[11]=sum(case
when datepart(hh, mdate)>=11 and datepart(hh, mdate)<12 then 1 else 0 end)
,[12]=sum(case
when datepart(hh, mdate)>=12 and datepart(hh, mdate)<13 then 1 else 0 end)
,[13]=sum(case
when datepart(hh, mdate)>=13 and datepart(hh, mdate)<14 then 1 else 0 end)
,[14]=sum(case
when datepart(hh, mdate)>=14 and datepart(hh, mdate)<15 then 1 else 0 end)
,[15]=sum(case
when datepart(hh, mdate)>=15 and datepart(hh, mdate)<16 then 1 else 0 end)
,[16]=sum(case
when datepart(hh, mdate)>=16 and datepart(hh, mdate)<17 then 1 else 0 end)
,[17]=sum(case
when datepart(hh, mdate)>=17 and datepart(hh, mdate)<18 then 1 else 0 end)
,[18]=sum(case
when datepart(hh, mdate)>=18 and datepart(hh, mdate)<19 then 1 else 0 end)
,[19]=sum(case
when datepart(hh, mdate)>=19 and datepart(hh, mdate)<20 then 1 else 0 end)
,[20]=sum(case
when datepart(hh, mdate)>=20 and datepart(hh, mdate)<21 then 1 else 0 end)
,[21]=sum(case
when datepart(hh, mdate)>=21 and datepart(hh, mdate)<22 then 1 else 0 end)
,[22]=sum(case
when datepart(hh, mdate)>=22 and datepart(hh, mdate)<23 then 1 else 0 end)
,[23]=sum(case
when datepart(hh, mdate)>=23 and datepart(hh, mdate)<24 then 1 else 0 end)
,总数=count(convert(varchar(10), mdate, 120))
from ip
group by convert(varchar(10), mdate, 120) order by convert(varchar(10), mdate, 120)
GO
存储过程执行后结果如下
日期 0 1 2 3 。。。。。23
2004/8/5 22 22 33 44 88
结果有很多但是在网页中显示分页不知道怎么办了
Top
3 楼angel2a(天使之守护)回复于 2005-08-25 11:01:42 得分 5
要建立Adodb.Recordset对象
直接exec好像不支持pagecount的Top




