查看完整版本: VB6调用存储过程报错:对象关闭时,不允许操作

twy1392336 2010-10-14 22:09

VB6调用存储过程报错:对象关闭时,不允许操作

存储过程如下:
if exists(select name from sysobjects where name='DeleteGroupHd' and type='P' )
   drop proc DeleteGroupHd
go
Create Proc DeleteGroupHd @CGN varchar(5)
as
    delete from MaItemHd where CategoryNo in (select CategoryNo from MaCategoryHd where CategoryGroupNo=@CGN)
    delete from MaCategoryHd where CategoryGroupNo=@CGN
    delete from MaCategoryGroupHd where CategoryGroupNo=@CGN
go

VB代码如下:
Adodc1.RecordSource = "execute DeleteGroupHd '" & Left(Combo1.Text, InStr(1, Combo1.Text, " ") - 1) & "'"
Adodc1.Refresh
请问NOTHING,怎样解决?

Nothing 2010-10-15 09:05

你的存储过程没有反回值,不能和adodc
使用Connection对象
Connection.execute("要执行的代码")
页: [1]
查看完整版本: VB6调用存储过程报错:对象关闭时,不允许操作