Re: Populating a combo from a database table faster




This one would be better.

Combo.items.BeginUpdate;
CodeQuery.DisableControls;
try
Combo.items.clear;
CodeQuery.First; // ADO dataset
while not CodeQuery.Eof do begin
Combo.Items.Add(CodeQuery.Fields[0].AsString);
CodeQuery.Next;
end;
finally
Combo.items.EndUpdate;
CodeQuery.EnableControls;
end;

And, if you have any controls bound to CodeQuery, you might
want to bookmark the current location and return to it
before CodeQuery.EnableControls is issued. Left as a
further excercise.
.