Results 1 to 27 of 27

Thread: [RESOLVED]BOF and EOF [/RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Addicted Member Beengie's Avatar
    Join Date
    Nov 2003
    Location
    Central Valley, CA
    Posts
    243

    [RESOLVED]BOF and EOF [/RESOLVED]

    Well...
    it's all mendhak's fault

    I changed over my ADO object to the code...

    I having a problem with EOF and BOF. When I reach BOF or EOF I get this error:
    Run-time error '3021':
    Either BOF or EOF is True, or the current record has been deleted.
    Requested operation requires a current record.

    Here is my code:
    VB Code:
    1. Public Sub Form_Load()
    2.  
    3.     Set cn = New ADODB.Connection
    4.     cn.ConnectionString = "Provider=Microsoft.jet.OLEDB.4.0;Data Source=" & App.Path & "\bb-calc.mdb"
    5.     cn.Open
    6.     Set rs = New ADODB.Recordset
    7.     rs.Open "SELECT * from tblBrushBed", cn, adOpenDynamic, adLockPessimistic
    8.     FillFields
    9. End Sub
    10.  
    11. Private Sub cmdPrev_Click()
    12.     If rs.BOF = False Then
    13.         rs.MovePrevious
    14.         FillFields
    15.     End If    
    16. End Sub
    17.  
    18. Private Sub cmdNext_Click()
    19.     If rs.EOF = False Then
    20.         rs.MoveNext
    21.         FillFields
    22.     End If
    23. End Sub
    Last edited by Beengie; Dec 2nd, 2003 at 03:27 AM.
    BeengieHappy.Vaue = (SharksScore > OpponentsScore)

    Go Sharks!

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