Visual Basic Online Course - Run-time error '3021' : Either BOF or EOF is True, or the current record has been deleted.

Visual Basic Online Course

Run-time error '3021' : Either BOF or EOF is True, or the current record has been deleted.
Case :
In Visual Basic 6.0 project with Database (e.g: MS-Access 2003) table, while trying to navigate through records you get the following error message.
Error No. :
3012
Error description :
Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record
Solution :



Comments

  1. im getting same error while updating and deleting the data,,pls help

    ReplyDelete
  2. im getting the same error while updating and deleting the record set,,pls help

    ReplyDelete
  3. The solution has already been posted in the Tip above .... Isn't it helping ?

    ReplyDelete
  4. An impressive share! I've just forwarded this onto a friend who was doing a little homework on this.
    And he in fact ordered me breakfast due to the fact that I discovered it for him...

    lol. So allow me to reword this.... Thanks for the meal!!
    But yeah, thanx for spending the time to talk about this matter here on your web site.


    My homepage :: DarrelXSaborido

    ReplyDelete
  5. Excellent way of explaining, and pleasant paragraph to get information regarding my presentation focus, which i am going to convey in academy.


    Here is my webpage :: DouglassRGearan

    ReplyDelete
  6. I am extremely inspired along with your writing skills as smartly as with the format in your weblog.

    Is this a paid theme or did you customize it yourself?

    Anyway stay up the nice high quality writing, it's uncommon to peer a great blog like
    this one nowadays..

    my website EvelyneKWiedenheft

    ReplyDelete
  7. I was suggested this blog by way of my cousin. I'm now not positive whether or
    not this post is written by way of him as no one else know such particular
    approximately my difficulty. You're wonderful!
    Thank you!

    my homepage; AnamariaKTenny

    ReplyDelete
  8. You have made some decent points there. I checked on the web
    for more information about the issue and found most
    individuals will go along with your views on this web site.


    Check out my blog: DewayneLOare

    ReplyDelete
  9. Heya i am for the first time here. I came across this board and I find It
    truly helpful & it helped me out much. I am hoping to offer something again and aid others like you aided me.


    Also visit my page CristiAMaroney

    ReplyDelete
  10. I've been exploring for a bit for any high-quality articles or weblog posts on this sort of space .
    Exploring in Yahoo I at last stumbled upon this web site.
    Studying this info So i am glad to exhibit that I have an incredibly good
    uncanny feeling I came upon just what I needed.
    I so much surely will make sure to don?t disregard this web site and provides it
    a look regularly.

    Also visit my page :: AdrienYMckeirnan

    ReplyDelete
  11. Hey! Would you mind if I share your blog with my myspace group?
    There's a lot of folks that I think would really enjoy your content.
    Please let me know. Cheers

    My website - AgustinHBrandly

    ReplyDelete
  12. I face to same problem
    here source code,,,,,

    Dim con As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim str As String


    Private Sub addbtn_Click()
    rs.AddNew
    End Sub

    Private Sub Combo1_Click()
    Combo2.Clear
    If Combo1.Text = "Computer Science" Then
    Combo2.AddItem "M.C.E"
    Combo2.AddItem "B.S.C"
    Combo2.AddItem "B.S.C(IT)"
    ElseIf Combo1.Text = "Electrical Engineering" Then
    Combo2.AddItem "B.TECH (EE)"
    Combo2.AddItem "M.TECH (EE)"
    ElseIf Combo1.Text = "Civil Engineering" Then
    Combo2.AddItem "B.TECH (CE)"
    Combo2.AddItem "M.TECH (CE)"
    Else
    End If
    End Sub

    Private Sub Form_Load()
    con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\VB6 Tuto\ST\stdata.mdb;Persist Security Info=False"
    rs.Open "Select * from ProfileDB", con, adOpenDynamic, adLockPessimistic


    Combo1.AddItem "Computer Science"
    Combo1.AddItem "Electrical Engineering"
    Combo1.AddItem "Civil Engineering"
    End Sub

    Private Sub savebtn_Click()
    rs.Fields("Roll_No").Value = Text1.Text
    rs.Fields("Name").Value = Text2.Text
    rs.Fields("DOB").Value = DTPicker1.Value
    If Option1.Value = True Then
    rs.Fields("Gender") = Option1.Caption
    Else
    rs.Fields("Gender") = Option2.Caption
    End If
    rs.Fields("Dept").Value = Combo1.Text
    rs.Fields("Course").Value = Combo2.Text
    rs.Fields("Address") = Text3.Text
    rs.Fields("Photo").Value = str
    MsgBox "Data save successfully", vbInformation
    rs.Update


    End Sub

    Private Sub uploadbtn_Click()
    CommonDialog1.ShowOpen
    CommonDialog1.Filter = "Jpeg|*.jpg"
    str = CommonDialog1.FileName
    Picture1.Picture = LoadPicture(str)
    End Sub

    ReplyDelete
    Replies
    1. Solution is posted above already :

      'E.g: Moving to next record
      'Make sure your table is not empty
      If RS.RecordCount = 0 Then Exit Sub
      'Make sure the Absolute Position of the record's cursor is at
      'the right position, If not then Exit Sub
      'If the Absolute Position reached the last record then Exit Sub.
      If RS.AbsolutePosition = Val(RS.RecordCount) Then
      Exit Sub
      End If
      'Navigate [MoveNext]
      RS_.MoveNext
      Text1.Text = RS!FieldName1
      Text2.Text = RS!FieldName2

      Delete
  13. But My datbase(access 2007) is empty

    ReplyDelete
  14. same code as (sarur abhi) Sir but my database is empty so what i write for this

    ReplyDelete
  15. sir i need ur help code is same but my database is empty

    ReplyDelete

Post a Comment

visual basic 6 source code says (Hi)

VB6 Popular Posts

Free download Visual Basic 6 Documentation MSDN

VB 0.6 TreeView Control lesson Part3

VB 0.6 TreeView Control Lesson Part2