I just need to find some other solution ...
I currently write a database program using Firebird. I need it to be more fault tolerance.
So the program should not open, use and share a single connection for the whole runtime. When needed, for example user clicks a button, it automatically creates and sets a database connection, runs the query, then closes and frees the connection immediately. It keeps the connection active as short as possible, if something bad happens the chances to 'damage' the database becomes lower.
For that reason, it cannot use TDBGrid. Instead it uses
TStringGrid. For showing the data on the grid, it connects to the database, runs a query to read 20 items and closes the connection immediately. The form has a previous page and next page buttons. And you need to manually keep which page number is currently showing.
I tested the concept using some generated data (50k records), it seemed to work correctly and there wasn't any noticeable performance impact. Maybe you can use the trick, by loading only a small amount of the data (a page), it should use very little amount of memory.