如何判断recordset是否打开?? 如何判断recordset是否打开?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用一个on error语名判断recorder对象打开是否有错,有错误就会到 on error定义的出错处理去,无错再就recordcount判断是否有记录 if isnull(recordset) then msgbox "recordset is open"else msgbox "recordset is nothing"end if if rs.state=adstateopen then 楼上的楼上,你的代码错了,应该是这样的注:rs1为ADODB.Recordset对象If IsNull(rs1) Then MsgBox "recordset is nothing"Else MsgBox "recordset is open" rs1.CloseEnd If rs.state=adstateopen 表示 记录集 被 打开~~~可以进行对 rs.state=adstateopen 的判断结分~ 我支持这个if rs.state=adstateopen then 假设你的记录集其它属性设置完毕State属性为测试记录集的状态private rs as new adodb.recordsetif rs.state=adstateopen then '如果记录集的状态是打开的rs.close '那么关闭它end if如果答对了,请别忘记了给分啊。谢了 if rs is nothing then exit subif rs.state=0 then set rs=nothing:exit sub 在vb中如何判断某一个sheet是否为空 同一工程中,DLL与窗体间传参数的问题(急!) 请教两个MSHFlexGrid的问题 最新版QQ魔法表情实现原理? 关于DataCombox的问题 怎么用vb函数删除一个指定的文件? 关于VB中编写HELP文件 心情太恶劣了!!散分散分…散光它…散光它!! 我把我的ip地址放在公网的server上让别人可以给我发udp,我应该写什么? 用DAO连接Access数据库更新问题 如何获得各个已经打开的WINDOWS窗口句柄? 在英文版的WindowsXP上使用CHR转换汉字的ASC码出错,例如CHR(-11087)
msgbox "recordset is open"
else
msgbox "recordset is nothing"
end if
MsgBox "recordset is nothing"
Else
MsgBox "recordset is open"
rs1.Close
End If
State属性为测试记录集的状态
private rs as new adodb.recordset
if rs.state=adstateopen then '如果记录集的状态是打开的
rs.close '那么关闭它
end if
如果答对了,请别忘记了给分啊。谢了
if rs.state=0 then set rs=nothing:exit sub