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
-
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
-
Do While Not rs.EOF
-
'your statement goes here
-
Loop
-
or
-
While Not rs.EOF
-
'your statement goes here
-
Wend
-