I am implementing a set of imageWell (4) to navigate thru a SQLite db.
All seems OK excepted MovePrevious: it goes before the first Record: the last click clears the window Controls contents.
Any hint on how I can stop it at the first Record ?
PS: I use a simple MovePrevious
to go to the previous Record. And that works all the way from the MoveLast
'till MoveFirst
even if it is written in the developper manual that moveprevious is supported in the sqlite databases, I only rely on movenext for any recordset. convert the data you need into an array, or re-query the recordset to go to the beginning of the recordset.
assume that only movenext is working.
Jean-Yves:
Thanks for your answer.
MoveFirst works fine. It is MovePrevious who leads me in a “non existant” Record located before the first Record.
I already saw this trap, but I do not remember how I avoid that. Maybe tomorrow morning will allow me to have a brand new (and working) idea ?
I just have an idea
Store current Unique ID,
Go to the first Record and compare this Unique ID with the one I stored earlier: if they are the same, I already display that Record.
I will try that later when back home.
when you get your recordset, simply move the primarykey of the reocrdset into an array.
then access the datas you need using this recorded primarykey and a simple query.
the selected datas won’t move, and you don’t need to make previous or first movements.
[quote=366979:@Emile Schwarz]Store current Unique ID,
Go to the first Record and compare this Unique ID with the one I stored earlier: if they are the same, I already display that Record.[/quote]
You could do the same by checking rs.BOF like you proposed in the title. Its meaning is exactly tailored to your issue: To avoid addressing the recordset before its first record. So if BOF is true you need one MoveNext (or have an empty recordset).
Hi Ulrich,
Thanks for your answer.
I tried that, but now I think I tried bad / wrong. I will try once more tomorrow morning. I seems to be in better condition on mornings