UD2006
08-28-2009, 11:35 PM
I want to add records from an adoquery, with dbgrid (online database) into a listbox. The records in the adoquery have 1 column (songtitle).
I managed to get 1 record into the listbox, but when I try to add another one, the first one is replaced, how can I put the next records after the 1 one (not replacing it)?
This is the code I use to copy the record from adoquery1 to listbox1.
procedure TForm1.Button2Click(Sender: TObject);
begin
DBListBox1.Items.Clear;
DBListBox1.Items.Add(ADQuery1.FieldByName('songtitle').AsString);
end;
I managed to get 1 record into the listbox, but when I try to add another one, the first one is replaced, how can I put the next records after the 1 one (not replacing it)?
This is the code I use to copy the record from adoquery1 to listbox1.
procedure TForm1.Button2Click(Sender: TObject);
begin
DBListBox1.Items.Clear;
DBListBox1.Items.Add(ADQuery1.FieldByName('songtitle').AsString);
end;