Hello,
I'm writing a form for anagraphical data entry, and I would like city of birth & residence fields to autocomplete. The list of items to deal with is quite large, i.e. the 8000 cities of my country (Italy).
Firstly I tried to work it out using a combobox, populated at runtime with the query result from a proper db (see hereunder the code).
In order to make the application as portable as it may, and having to deal with both Windows and Linux clients, I had to notice a very different performance, in terms of time response, between the two environments, on machines with similar capabilities.
On Windows, the population of the item list took about 2 seconds, which is a long but reasonable time for my need; on Linux, the duration of the same operation increases 10 times, forcing OS to send a signal about task not responding.
Actually, it's not necessary for me to use a combobox, which control I choose only because of native autocomplete feature.
Any suggestions? Thank you.
if openDB('codfisc.db')
then
begin
combo.Clear;
try
dbquery.SQL.Text:= 'SELECT DESCR FROM COMUNI ORDER BY DESCR';
dbquery.Open;
while not dbquery.EOF do
begin
combo.Items.Add(dbquery.FieldByName('DESCR').AsString);
dbquery.Next;
end;
finally
closeDB;
end;
end;