View Full Version : TTable & TDBGrid
I use TDBGrid for showing the data from table with 150000 record and 10 field.
My question is, why is take along time for activing the table (Maybe the TTable load all data), I used many kind database, like dBase, Oracle, Sybase Anywhere, MySql, Access and they give me same result (long..long time).
Can somebody help me...?
With BDE or? If You use BDE or ODBC with TTable then TTable loads all records from table.
Try with Interbase - use IBQuery and do not fetch all records when you activate Query.
Results on P150 with 32MB and local Interbase6:
about 5 seconds.
01-07-2001, 08:57 PM
actually the dbgrid is a control based on arrays and before showing itself it populates all the arrays so in your case
it means populating 15000 (rows) X 10( fields) that is 1,50,000 elements of arrays are required to be fetched from the server or whatever database and saved to array tables and then related display is to be updated.
to get faster results you can do any of the following as per your specifications
1) use a query component with rowset size set at some optimal level say 100 or so
2) use query with proper where clause etc
3) in case of table, just before opening delink the controls
then set some sort of filter
like table1.filter := 'name = ''' + edit1.text + '''';
table1.filtered := true;
and then finally when rest everything is done enable the controls once again
this should definately solve your problem but in case the you dont really need the dbgrid use the form layout it is always much much faster than grids
for any other help you can contact me at " firstname.lastname@example.org "
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.