日期:2014-05-17  浏览次数:20744 次

ASP调用存储过程问题
我有一个存储过程AGJBRN,内容是执行一些关联和计算后,返回筛选过的数据.
最后是这样的:
CREATE   PROCEDURE   dbo.AGJBRN   AS
set   nocount   on
…………………………
if     exists   (Select   *   From   sysobjects   where   name= 'AGJBR '   and   xtype= 'U ')
drop   table   AGJBR
select   *     into   AGJBR   from   #AGJ10
GO
就是把记录放到一个表AGJBR中去。
现在我想在网页中执行这个存储过程,然后显示AGJBR这个表,要怎样做呢?

------解决方案--------------------
set rs=conn.execute( "execute name ")
括号里面是执行过程那个命令,我忘记了
------解决方案--------------------
CREATE PROCEDURE dbo.AGJBRN AS
set nocount on
…………………………
if exists (Select * From sysobjects where name= 'AGJBR ' and xtype= 'U ')
drop table AGJBR
select * into AGJBR from #AGJ10
select * FROM AGJBR
GO

ASP:


Set oCnn = CreateObject( "ADODB.Connection ")
oCnn.Open SQLConnection
Set oCommand = CreateObject( "ADODB.Command ")
oCommand.CommandText = "AGJBRN "
oCommand.CommandType = 4
Set .ActiveConnection = oCnn
Set oRS = oCommand.Execute
Set .ActiveConnection = Nothing
Do While Not oRS.EOF
...
Loop
Set oCommand = Nothing
oRS.Close
Set oRS = Nothing