发新话题
打印

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

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,怎样解决?

TOP

你的存储过程没有反回值,不能和adodc
使用Connection对象
Connection.execute("要执行的代码")
换个头像,看见广告就眼红,直接封ID。

TOP

发新话题