运行时错误3705 .............. [英] run time error 3705..............

查看:264
本文介绍了运行时错误3705 ..............的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Dim startstg As String
Dim EndStg As String
Dim date1 As String
Dim date2 As String

Private Sub Command1_Click()

Call Connect

esql = "select * from bank where Date>=3DCDate('" & DTPicker1.Value & "') AND Date<=3DCDate('" & DTPicker2.Value & "')"
rs.Open esql, con, adOpenForwardOnly, adLockReadOnly

End Sub



msg:ERROR 3705 - 对象打开时不允许操作


msg : ERROR 3705 - Operation is not allowed when the object is open

推荐答案

rs可能已在代码中的其他位置打开,因为您尚未关闭它。这是使用全局变量的问题,很容易失去对它们的跟踪以及它们的状态。确保在不再需要时关闭它们。
"rs" is probably already open elsewhere in your code because you haven't closed it. This is the problem with using global variables, it becomes very easy to lose track of them and what their state is. Make sure you close things when you no longer need them.


这篇关于运行时错误3705 ..............的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆