[Solved] Start at beginning of dataset? lazarus / 16-Databases ---------------------------------------------------------------------- rickielynn · 2018-01-03 05:06 I'm using SQLite with Lazarus to select a subset of a database using the SELECT statement.  Then I want to do something with that dataset by using a While NOT SQLQuery.EOF DO followed by statements. My question is how can I be sure I'm starting at the beginning of the dataset?  Some of the dataset is not getting affected by the statements after the While NOT...statement.   I'd like to use a SQLQuery.MoveFirst statement before the While Not, but don't see one available. Thanks, Rick ---------------------------------------------------------------------- balazsszekely · 2018-01-03 05:12 Before the while loop insert: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i SQLQuery.First; ---------------------------------------------------------------------- dsiders · 2018-01-03 05:20 TSqlquery has the navigation methods inherited from TDataset: First, Next, Prior, and Last. ---------------------------------------------------------------------- rickielynn · 2018-01-03 18:57 I think the problem was I was deleting a record inside the While Not .EOF loop and that was somehow causing a record to be missed.  I changed the While Not .EOF to a FOR...DO loop then jump out of the loop if SQLQyery.Recordset=0 and it seems to work. Thanks, Rick