CSDN首页 空间 新闻 论坛 Blog 下载 读书 网摘 搜索 .NET Java 视频 接项目 求职 在线学习 买书 程序员 通知
不看会后悔的Windows XP之经验谈 简单快捷DIY实用家庭影院
CSDN社区
搜索 收藏 打印 关闭
CSDN社区 >  MS-SQL Server >  疑难问题

asp+sqlserver的执行存储过程分页问题

楼主jiedushi(东杰)2005-08-24 10:04:37 在 MS-SQL Server / 疑难问题 提问

我在用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

相关问题

  • 谁有asp存储过程分页的源码例子?
  • asp存储过程分页,急!!!!!!!!在线等!
  • 用asp调用分页存储过程出错
  • help:分页存储过程。。。。。。。。。
  • 求分页存储过程
  • 分页存储过程
  • 如何使用asp创建sqlserver的存储过程和执行存储过程
  • *****请问在ASP中如何调用存储过程进行分页!!!*****
  • 谁可以帮帮我在asp里调用这段分页存储过程啊?????
  • 没写过存储过程,请教这样的asp程序如何写成sqlserver的存储过程

关键词

  • 存储过程
  • 执行
  • ip
  • mdate
  • hh
  • 分页
  • 问题
  • rs
  • and datepart

得分解答快速导航

  • 帖主:jiedushi
  • wgsasd311
  • angel2a

相关链接

  • SQL Server类图书

广告也精彩

反馈

请通过下述方式给我们反馈
反馈
提问
网站简介|广告服务|VIP资费标准|银行汇款帐号|网站地图|帮助|联系方式|诚聘英才|English|问题报告
北京创新乐知广告有限公司 版权所有, 京 ICP 证 070598 号
世纪乐知(北京)网络技术有限公司 提供技术支持
Copyright © 2000-2008, CSDN.NET, All Rights Reserved
GongshangLogo