PDA

View Full Version : TTable & TDBGrid


N/A
12-07-2000, 02:54 PM
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...?

N/A
12-07-2000, 09:14 PM
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.

digitiger
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
like
try
begin

table1.disablecontrols;
table1.open;
then set some sort of filter

like table1.filter := 'name = ''' + edit1.text + '''';
table1.filtered := true;
end;
and then finally when rest everything is done enable the controls once again

finally
table1.enablecontrols;

end;


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 " digitiger@pcgeek.net "