3705 "operation is not allowed when the object is open" in vb6
Please Solve thisCode: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


Reply With Quote

