怎么关闭没打开但创建的记录集对象?

记录集初始只是创建但并没有打开,在执行这段代码时总报错说记录集类型的错误,去掉rs.close就好了,可rs并没有打开呀,怎么会执行打开时的代码呢.
if rs.state=adstateopen then
rs.close
set rs=nothing
end if
if cnn.state=adstateopen then
cnn.close
set cnn=nothing
end if
---------------------------------------------------------------

你是不是用execute打开的rs?
用这种方式打开的rs好象只能用set rs=nothing关闭。
---------------------------------------------------------------

rs.close
set rs=nothing
cnn.close
set cnn=nothing
这样关是没有问题的。打开有rs.open或cnn.execute两种

Published At
Categories with Web编程
Tagged with
comments powered by Disqus