altric
asked on
Insert record loop not shown on the grid
Good day, everyone.
I have a function to carry out that is trying to insert 100,000 record into a table.
So, I try to implement in the following way:
-------------------------- ---------- ---------- ----------
procedure form1.Button1Click(Sender: TObject);
var runLength, runtime : longint;
begin
runLength := 100,000;
runtime := 1;
While runtime <= runLength do begin
tableX.Append;
tableXName.value := 'cust' + IntToStr(runtime);
runtime := runtime + 1;
tableX.post;
end;
tableX.close;
end;
-------------------------- ---------- ---------- ---------- -
Why I couldn't see the record being inserted into the grid while the loop is running.
Thank you.
I have a function to carry out that is trying to insert 100,000 record into a table.
So, I try to implement in the following way:
--------------------------
procedure form1.Button1Click(Sender:
var runLength, runtime : longint;
begin
runLength := 100,000;
runtime := 1;
While runtime <= runLength do begin
tableX.Append;
tableXName.value := 'cust' + IntToStr(runtime);
runtime := runtime + 1;
tableX.post;
end;
tableX.close;
end;
--------------------------
Why I couldn't see the record being inserted into the grid while the loop is running.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
A bit slow...anyway to speed it up?
you can change value:
(runtime mod 100)
change it
(runtime mod 1000)
(runtime mod 100)
change it
(runtime mod 1000)
(will you really see it? -> costs performance)