Got an ADO RECORDSET and
Did a move first...
A Subsequent MOVE NEXT.. doesn't get me to the next record
I have to do 2 MOVENEXT to get to it
Any idea why?
Is that a bug?
Printable View
Got an ADO RECORDSET and
Did a move first...
A Subsequent MOVE NEXT.. doesn't get me to the next record
I have to do 2 MOVENEXT to get to it
Any idea why?
Is that a bug?
It sound as if your provider moves to BOF instead of the first record when you call the MoveFirst method.
But I can actually look at the record after a movefirst...
Yeah that is fully possible, a lot of providers return the first record when you stand on BOF as long as the recordset isn't empty.
but... Another subsequent next would yield the next record, I suppose... Not so..
do you have a blank record in the database?Quote:
Originally posted by Lafor
Got an ADO RECORDSET and
Did a move first...
A Subsequent MOVE NEXT.. doesn't get me to the next record
I have to do 2 MOVENEXT to get to it
Any idea why?
Is that a bug?
No, if you stand on BOF a call to move next will move to the first record.Quote:
Originally posted by Lafor
but... Another subsequent next would yield the next record, I suppose... Not so..
VB Code:
rs.MoveFirst If rs.BOF Then rs.MoveNext End If
but calling the .MoveFirst method puts you at the first record.. not before itQuote:
Originally posted by Joacim Andersson
No, if you stand on BOF a call to move next will move to the first record.VB Code:
rs.MoveFirst If rs.BOF Then rs.MoveNext End If
Not really .... it puts the RecordPointer on BOF ... 1 before the first record. But as soon as you start reading it, it increases the record pointer by 1 automatically for the first time.Quote:
Originally posted by kleinma
but calling the .MoveFirst method puts you at the first record.. not before it
well what i am saying is if you doQuote:
Originally posted by techyspecy
Not really .... it puts the RecordPointer on BOF ... 1 before the first record. But as soon as you start reading it, it increases the record pointer by 1 automatically for the first time.
VB Code:
RS.Open "SELECT BLAH FROM BLAH" RS.MoveFirst Do Until RS.EOF Debug.Print RS(0) RS.MoveNext Loop
you will get all records without missing the first and without skipping any
True - but that may not neccesarily mean that record 1 holds the record pointer when you do movefirst.Quote:
Originally posted by kleinma
well what i am saying is if you do
VB Code:
RS.Open "SELECT BLAH FROM BLAH" RS.MoveFirst Do Until RS.EOF Debug.Print RS(0) RS.MoveNext Loop
you will get all records without missing the first and without skipping any
If you read the origional question and my first reply you'll see that it seems as if his provider is treating this wrong.Quote:
Originally posted by kleinma
but calling the .MoveFirst method puts you at the first record.. not before it
Nothing is treating him wrong. Its absolutely right. He click on the button until he is on first record and first record gets displayed in the text boxes and then he clicks again which puts the record pointer in the BOF position. Mind you, first record is not BOF. BOF comes when you do MovePrevious on first record. Now he clicks the other button for movenext. When he clicks once, the record pointer comes on first record and first record is already displayed so it looks as if nothing has happened. When he clicks again the record pointer moves to 2nd record and 2nd record gets displayed and so on.Quote:
Originally posted by Joacim Andersson
If you read the origional question and my first reply you'll see that it seems as if his provider is treating this wrong.
There is nothing wrong with any provider or anything. This is ADO phenomenon and it has nothing to do with Providers.
Think I found what the prob is
This table for some reason has duplicate entries...
And the way the original programmer wrote the code to navigate through the recordset was:
Display current record
Do a move first to get to the first record and
and compare with the displayed record
if same then do a move next
and that would repeat everytime the > button is pressed..
Check my last post .... there is nothing wrong with your code i think.Quote:
Originally posted by Lafor
Think I found what the prob is
This table for some reason has duplicate entries...
And the way the original programmer wrote the code to navigate through the recordset was:
Display current record
Do a move first to get to the first record and
and compare with the displayed record
if same then do a move next
and that would repeat everytime the > button is pressed..
MoveFirst followed by MoveNext should result in him standing on the the second record, right? In his origional post he said he didn't (though he probably is since he has duplicats in hid DB).Quote:
Originally posted by techyspecy
Check my last post .... there is nothing wrong with your code i think.
thats what im sayin :DQuote:
Originally posted by Joacim Andersson
MoveFirst followed by MoveNext should result in him standing on the the second record, right? In his origional post he said he didn't (though he probably is since he has duplicats in hid DB).
Sorry guys, i thought he was talking about MovePrevious.
Yeah but according to his origional question he was still standing on the first record after calling MoveNext.
Well, he should probably put a text box on the form and do this ...
on each movenext ...
text1.text = Recordset.AbsolutePosition
this will at least tell him whether recordset is moving or not ....
My fault..
I gave a hasty and false assertion of what I thought was going on
So...
Thanks all for responding...
On another note....[to change the subject]
What a beautiful day it is around here!!!