asp对数据库的操作中判断连接对象的状态

在asp数据库操作程序中经常要关闭记录集对象清除对象,如果重复进行清除操作就会出现错误,一个解决的方法是先对对象的状态进行判断然后在进行相应的操作。如有问题竟联系我(vince6799@hotmail.com)或到本站获取最新信息(www.miplat.com)。

sub closers(crs)
if Not crs Is Nothing Then '对象未清除
if (crs.state and 1)=1 then
crs.close
end if
set crs=nothing
end if
end sub
sub endconnection(Econn)
if Not Econn is Nothing then
if (Econn.state and 1)=1 then
Econn.close
end if
set Econn=nothing
end if
end sub

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值