ASP通过 rs 取得存储过程返回的两表,第二个表怎么取得。
伊点阳光 2006-11-16 05:03:04 存储过程: declare @TotalCount int declare @PageCount int declare @PageIndex int declare @StartRow int select @TotalCount=count(*) from testtable where 1=1 if @PageCount <= 0 begin select id,firstname,lastname,country,note from testtable where 1<>1 select 0 as PageIndex,0 as PageCount,10 as PageSize,0 as TotalCount return end set @PageCount=(@TotalCount+10-1)/10 set @PageIndex=6000 if @PageIndex<0 set @PageIndex=1 if @PageIndex>@PageCount and @PageCount>0 set @PageIndex=@PageCount set @StartRow=(@PageIndex-1)*10+1 declare @Sort varchar(100) set rowcount @StartRow select @Sort=id from testtable where 1=1 order by id asc set rowcount 10 select id,firstname,lastname,country,note from testtable where 1=1 and id>=@Sort order by id asc select @PageIndex as PageIndex,@PageCount as PageCount,10 as PageSize,@TotalCount as TotalCount
id firstname lastname country note
----------- ---------------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------------- -------------------------------------------------- ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
59990 firstname_xxx_59990 astname_xxx_59990 country_xxx59990 note_xxx59990
59991 firstname_xxx_59991 astname_xxx_59991 country_xxx59991 note_xxx59991
59992 firstname_xxx_59992 astname_xxx_59992 country_xxx59992 note_xxx59992
59993 firstname_xxx_59993 astname_xxx_59993 country_xxx59993 note_xxx59993
59994 firstname_xxx_59994 astname_xxx_59994 country_xxx59994 note_xxx59994
59995 firstname_xxx_59995 astname_xxx_59995 country_xxx59995 note_xxx59995
59996 firstname_xxx_59996 astname_xxx_59996 country_xxx59996 note_xxx59996
59997 firstname_xxx_59997 astname_xxx_59997 country_xxx59997 note_xxx59997
59998 firstname_xxx_59998 astname_xxx_59998 country_xxx59998 note_xxx59998
59999 firstname_xxx_59999 astname_xxx_59999 country_xxx59999 note_xxx59999
(所影响的行数为 10 行)
PageIndex PageCount PageSize TotalCount
----------- ----------- ----------- -----------
6000 10001 10 100001
(所影响的行数为 1 行)
以上为分页存储过程所返回的值。
返回值会返回两个表,通过以下方法取得:
sql="NFS_Dgcd_Net_YangYi_sp_PageSplitGood 'id','id,firstname,lastname,country,note','testtable','','id asc',6000,10"
set rs=conn.execute(sql)
这种方法只能取得第一个表的对象,取不到第二个表的对像。
ASP中怎么操作才能取得每二个表的值