+ -
当前位置:首页 → 问答吧 → asp调用存储过程,得不到记录

asp调用存储过程,得不到记录

时间:2011-08-01

来源:互联网

存储过程如下:
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[comp]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[comp]
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
CREATE PROC comp 
as
SET NOCOUNT ON
create table #comp(fcomp varchar(200),fconno varchar(200),fgoods varchar(200),fstarttime varchar(200),fendtime varchar(200),famount decimal(28,2),
fysamount decimal(28,2),fendamount decimal(28,2),ftime datetime,fxh varchar(200))
insert into #comp
select fname,'','','','',0,0,0,'','1' from company order by 1
insert into #comp
select fcomp,fconno,fgoods,fstarttime,fendtime,fconamount,fysamount,fendamount,ftime,'2' from contract order by fcomp,fconno,ftime
insert into #comp
select fcomp,fconno,fskxh,'-','-',famount,fysamount,fendamount,ftime,'3' from skplan order by fcomp,fconno,ftime
set nocount off
select * from #comp order by fcomp,fconno,fxh
drop table #comp
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


asp代码如下:
dim cmd
Set Cmd = Server.CreateObject("ADODB.Command")

Cmd.ActiveConnection = Conn
Cmd.CommandText = "Comp"
Cmd.CommandType = 4
cmd.Prepared = true

Set Rs = Cmd.Execute


请问是否那里有问题,我无论如何,都无法得到rs记录集的记录。好像是没取到记录数。

作者: ggzgeguoz   发布时间: 2011-08-01

http://topic.csdn.net/u/20110613/15/6d442ec9-f6e3-46b2-b4da-12d63fce07b3.html

作者: yaxiya   发布时间: 2011-08-01