3705 "operation is not allowed when the object is open" in vb6
3705 "operation is not allowed when the object is open" in vb6
Code:
Private Sub Command1_Click()
DataEnvironment1.Add Text1.Text, Text2.Text, Text3.Text, Text4.Text
MsgBox "Added Successfully"
End Sub
Private Sub Command2_Click()
DataEnvironment1.Delete Text2.Text
MsgBox " Deleted "
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
End Sub
Private Sub Command3_Click()
DataEnvironment1.Edit Text1.Text, Text2.Text, Text3.Text, Text4.Text
MsgBox " Edit Successfully"
End Sub
Private Sub Command4_Click()
DataEnvironment1.Search Text2.Text
With DataEnvironment1.rsSearch
If DataEnvironment1.rsSearch.EOF Then
MsgBox "Not Found"
Else
MsgBox "Found"
Text1.Text = DataEnvironment1.rsSearch.Fields("BookID")
Text2.Text = DataEnvironment1.rsSearch.Fields("Title")
Text3.Text = DataEnvironment1.rsSearch.Fields("Author")
Text4.Text = DataEnvironment1.rsSearch.Fields("Publisher")
End If
'.Close
End With
End Sub
Private Sub Command5_Click()
DataEnvironment1.CAdd Text5.Text, Text6.Text, Text7.Text, Text8.Text, Text9.Text, Text10.Text
MsgBox "Added Successfully"
End Sub
Private Sub Command6_Click()
DataEnvironment1.CSearch Text6.Text '\\Error move at this line
With DataEnvironment1.rsCSearch
'If DataEnvironment1.rsCSearch.EOF Then
'MsgBox "Not Found"
'Else
MsgBox "Found"
Text5.Text = DataEnvironment1.rsCSearch.Fields("Cteamname")
Text6.Text = DataEnvironment1.rsCSearch.Fields("Cname")
Text7.Text = DataEnvironment1.rsCSearch.Fields("Cage")
Text8.Text = DataEnvironment1.rsCSearch.Fields("Cexp")
Text9.Text = DataEnvironment1.rsCSearch.Fields("Cedu")
Text10.Text = DataEnvironment1.rsCSearch.Fields("Cnoc")
'End If
''.Close
End With
End Sub
Private Sub Command7_Click()
DataEnvironment1.CEdit Text5.Text, Text6.Text, Text7.Text, Text8.Text, Text9.Text, Text10.Text
MsgBox " Edit Successfully"
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Private Sub Command8_Click()
DataEnvironment1.CDelete Text6.Text
MsgBox " Deleted "
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Please Solve this
Re: 3705 "operation is not allowed when the object is open" in vb6
Welcome to VBForums :wave:
Thread moved to the 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)
Which line of code does the error occur on?
Re: 3705 "operation is not allowed when the object is open" in vb6
DataEnvironment1.CSearch Text6.Text '\\Error move at this line
Thanx to reply me.
i solve my error successfully now.
Re: 3705 "operation is not allowed when the object is open" in vb6
Thanx to reply me.
i solve my error successfully now.