0

I'm trying to load about 500k+ data linked to an Oracle DB on my TcxGrid, I want to make the process faster using the GridView "GridMode" property, but I need to do that using a TSQLQuery (DBExpress Component) and it just doesn't work, Gridmode seems inoperable (doesn't load data faster on the Grid, doesn't load custom quantity of records using the "BufferCount" property, etc.)

Here I created a TSQLQuery component and used a query script for my 500k table (for performance purposes I just got 500 values but I need to load 500k+):

TSQLQuery

When I link the TSQLDataSet to the Grid and activate the TSQLQuery it shows all the records from the query, even if the GridMode is TRUE and the GridModeBufferCount is 5

GridWithTSQLQuery

On the other hand, when I use a TQuery, the GridMode just works properly, in this case I had to open SQL Explorer, make the connection and assign that connection to the TQuery DataBase property:

SQLExplorer

Here I show my TQuery with the values mentioned before:

TQuery

And when I activate my TQuery.. voilá:

GridWithTQuery

What I'm doing wrong? or do I need to do more things on my TSQLQuery besides linking it to my dataset and then linking the dataset to the grid? It's impossible that a very old Tquery can do this and not a newer dbExpress component

Thank you so much guys

BaldwinIV
  • 147
  • 10
  • 1
    dbExpress provides a unidirectional result set that is unsuitable for hooking up directly to a grid. To get around that limitation the result is often used to populate a ClientDataset which is then used to source data for the gird. That doesn't work well for large result sets either. One option is to use recent releases of Delphi and the Developer Express Grid. You can then use Firedac data access components and Provider Mode with the Developer Express grid. – Brian Oct 24 '19 at 15:29
  • What @Brian says. A CDS hits a brick wall, performance-wise if you try to make it handle more than a few tens of K records. One way around that is to identify (or define) a natural key against your back-end table that allows you to simulate browsing the whole table by retrieving only a few hundred rows at a time (like browsing a paper phone directory). Btw you are not seriously trying to retrieve 500k rows at a time from a multi-user database are you? – MartynA Oct 24 '19 at 19:57
  • Btw, the short answer to "How to fix the TcxGrid GridMode" is that there's nothing to fix, it's working as designed. You are misunderstanding and misusing it (even if FireDac enables you to get closer to what you are wanting to achieve). – MartynA Oct 24 '19 at 20:11
  • Thank you for your repply @Brian, I finally made it using a ClientDataSet and a DataSetProvider linked together with the Query and the DataSource, you gave me the light – BaldwinIV Oct 24 '19 at 20:53

0 Answers0