Board logo

标题: [基础] 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("要执行的代码")




欢迎光临 编程开发论坛 (http://bbs.lihuasoft.net/) Powered by Discuz! 6.0.0