BOF and EOF record error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • deviii
    New Member
    • Aug 2007
    • 13

    BOF and EOF record error

    Hi VB experts

    I have one problem while connecting database . when i run my form it shows the error BOF or EOF record error. but i entered data in database.
    I used the condition

    Do until rs.EoF=true

    is it correct or wrong?
    what i do for this problem? any one help me please?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    if u are moving through the recordset u need to check for BOF & EOF

    if rs.bof =true then rs.movefirst

    if rs.eof=true then rs.movelast


    hope that helps you

    Comment

    • deviii
      New Member
      • Aug 2007
      • 13

      #3
      Thanks for ur reply sir but it cant help me. please send the detailed coding

      Comment

      • hariharanmca
        Top Contributor
        • Dec 2006
        • 1977

        #4
        Originally posted by deviii
        Thanks for ur reply sir but it cant help me. please send the detailed coding

        [CODE=vb]IF rstRecordSet.BO F = False Then rstRecordSet.Mo vePrevious

        IF rstRecordSet.EO F = False Then rstRecordSet.Mo veNext[/CODE]

        I think this will help you.

        Comment

        • pureenhanoi
          New Member
          • Mar 2007
          • 175

          #5
          Originally posted by deviii
          Hi VB experts

          I have one problem while connecting database . when i run my form it shows the error BOF or EOF record error. but i entered data in database.
          I used the condition

          Do until rs.EoF=true

          is it correct or wrong?
          what i do for this problem? any one help me please?
          "Do Until" routine always do all statements within Do Until...Loop. And then, it check the condition. If the condition still True, so do statements again. If the condition go to False, so exit routine.
          Take a look at your code. If your SQL statement brings up a Null recordset (RecordCount = 0). So the code that get data from RS within Do Until routine goes fail.
          To trap this error, you must check Null for Rs first
          Code:
          If rs.EOF Then Exit Sub     'do nothing if rs is null
          Do Until rs.EOF
          'your statements go here
          Loop
          Or using another routine
          Code:
          Do While Not rs.EOF
          'your statement goes here
          Loop
          or
          Code:
          While Not rs.EOF
          'your statement goes here
          Wend

          Comment

          • deviii
            New Member
            • Aug 2007
            • 13

            #6
            hi pureenhanoi thanks now i got result

            Comment

            • deviii
              New Member
              • Aug 2007
              • 13

              #7
              hello

              now i got one more doubt how we can do repititive operation in MSHFlex grid control? for example i wany to enter value in one column the square value of that number will automatically displayed in next coumn what can i do for it? please help me

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                Originally posted by deviii
                hello

                now i got one more doubt how we can do repititive operation in MSHFlex grid control? for example i wany to enter value in one column the square value of that number will automatically displayed in next coumn what can i do for it? please help me

                [CODE=vb]msfGrigName.Tex tMatrix(<Row Number>, <Column>)[/CODE]

                Comment

                • QVeen72
                  Recognized Expert Top Contributor
                  • Oct 2006
                  • 1445

                  #9
                  Hi deviii,

                  Check This:

                  [code=vb]
                  Dim i As Integer
                  For i = 1 To 10
                  Grd.Textmatrix( i, 1) = i
                  Grd.TextMatrix( I,2) =i * i
                  Next
                  [/code]

                  REgards
                  Veena

                  Comment

                  Working...