Results 1 to 4 of 4

Thread: 3705 "operation is not allowed when the object is open" in vb6

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    3

    Unhappy 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
    Last edited by si_the_geek; Oct 15th, 2011 at 06:43 AM. Reason: added Code tags

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: 3705 "operation is not allowed when the object is open" in vb6

    Welcome to VBForums

    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?

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    3

    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.

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 2011
    Posts
    3

    Re: 3705 "operation is not allowed when the object is open" in vb6

    Thanx to reply me.
    i solve my error successfully now.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width