Click here to Skip to main content
15,921,530 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
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 - Operation is not allowed when the object is open
Posted
Updated 25-Jun-15 22:05pm
v2

1 solution

"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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900