以前就遇到过 cadorecordset 打开时 提示 对象关闭的错误提示。
后来经过研究发现,是因为执行 了存储过程,并且返回临时表 而导致。
比如有一个存储过程 a
create procedure a
@id int
as
begin
select * into #tmp from t where id=@id
........
select * from #tmp
end
像这样的存储过程,在使用cadorecordset .execute (CadoCommand *pCmd)时,执行完毕,再次使用此cadorecordset 就会提示错误。
解决方法就是 不用使用临时表。

926

被折叠的 条评论
为什么被折叠?



