469,126 Members | 1,252 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,126 developers. It's quick & easy.

BOF and EOF record error

13
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?
Aug 29 '07 #1
8 2376
debasisdas
8,127 Expert 4TB
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
Aug 29 '07 #2
deviii
13
Thanks for ur reply sir but it cant help me. please send the detailed coding
Aug 29 '07 #3
hariharanmca
1,977 1GB
Thanks for ur reply sir but it cant help me. please send the detailed coding

Expand|Select|Wrap|Line Numbers
  1. IF rstRecordSet.BOF = False Then    rstRecordSet.MovePrevious
  2.  
  3. IF rstRecordSet.EOF = False Then    rstRecordSet.MoveNext
I think this will help you.
Aug 29 '07 #4
pureenhanoi
175 100+
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
Expand|Select|Wrap|Line Numbers
  1. If rs.EOF Then Exit Sub     'do nothing if rs is null
  2. Do Until rs.EOF
  3. 'your statements go here
  4. Loop
  5.  
Or using another routine
Expand|Select|Wrap|Line Numbers
  1. Do While Not rs.EOF
  2. 'your statement goes here
  3. Loop
  4.  
or
Expand|Select|Wrap|Line Numbers
  1. While Not rs.EOF
  2. 'your statement goes here
  3. Wend
  4.  
Aug 29 '07 #5
deviii
13
hi pureenhanoi thanks now i got result
Aug 29 '07 #6
deviii
13
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
Aug 29 '07 #7
hariharanmca
1,977 1GB
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

Expand|Select|Wrap|Line Numbers
  1. msfGrigName.TextMatrix(<Row Number>, <Column>)
Aug 29 '07 #8
QVeen72
1,445 Expert 1GB
Hi deviii,

Check This:

Expand|Select|Wrap|Line Numbers
  1. Dim i As Integer
  2. For i = 1 To 10
  3.   Grd.Textmatrix(i, 1) = i
  4.   Grd.TextMatrix(I,2) =i * i
  5. Next
  6.  
REgards
Veena
Aug 29 '07 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Susan Bricker | last post: by
5 posts views Thread by prakashwadhwani | last post: by
reply views Thread by Mortomer39 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.