Quick question.
MY SQL is returning the right amount of records. But when I loop through record set and assign a value to a button, its the same value for all the buttons.
CODE (that don't work)
queryScripts.SQL.Text := 'select DISTINCT(Category) from main ORDER BY Category';
queryScripts.PacketRecords:=-1; //fetch all records
SQLite3Connection1.Open;
SQLTransaction1.Active := True;
queryScripts.Open;
For x1:= 1 to dsScripts.dataset.RecordCount do
begin
btn1:=TColorSpeedButton.create(nil);
btn1.Caption:=dsScripts.Dataset.FieldByName('Category').AsString;
end;
What am I missing. My mind is a fog today.