How to display dataset in parts inside DBGrid (like phpmydmin's browse table) lazarus / 16-Databases ---------------------------------------------------------------------- Lazikas o Pontios · 2023-02-17 10:06 Hello, i have some tables in a project that may have thousands or millions of records. I believe that DBGrid cannot handle that much information (not mention that is not easy for user to find the wanted record). How can i mimic the behavior of phpmyadmin, to display only 25/50/any number of rows at any time? I can think a way that the SELECT query must use BETWEEN and/or LIMIT statements in order to handle the number of rows returned and a ScrollBar or upDown component to change the values of the BETWEEN statement. But since i am amateur in Lazarus Databases and i don't know how the components behave, i don't know if this approach will work without problems. So, in order not to reinvent the wheel (in an unknown to me way),  IS there any ready component that can split the dataset, as large as can it be, and display it in a dbgrid? Or, can you propose an approach, how to achieve the phpmydmin's BROWSE TABLE behavior? TIA, L. ---------------------------------------------------------------------- Zvoni · 2023-02-17 14:24 TSQLQuery has a PacketRecords-Property which defaults to 10. The best way IMO is to do it from the SQL-Query directly. Read the Documentation for "LIMIT"-Keyword LIMIT [Offset,] rowcount I will let you guess what "offset" is for.... ---------------------------------------------------------------------- egsuh · 2023-02-21 05:54 In Firebird, there are FIRST and SKIP features in SELECT statement. Following is excerpt from https://firebirdsql.org/refdocs/langrefupd20-select.html Quote    SELECT [FIRST ()] [SKIP ()] FROM ... FIRST and SKIP are both optional. When used together as in “FIRST m SKIP n”, the n topmost rows of the output set are discarded and the first m rows of the remainder are returned.