私のコードは以下のとおりですが、正しく機能していますが、プログラムをコンパイルした後、すべてのフルネームと国が縦にリストされているのがわかります。
_________________________________
フルネーム
1カントリー
1フルネーム2カントリー2
フルネーム3
カントリー
3
など..
SQLQuery1.SQL.Text := 'SELECT * FROM users where user_age="'+age+'"';
SQLQuery1.Open;
rec := SQLQuery1.RecordCount;
SQLQuery1.First; // move to the first record
ListView1.Visible := false;
if rec>0 then
begin
while(not SQLQuery1.EOF)do begin
ListView1.Visible := true;
// do something with the current item
ListView1.AddItem('Full name: '+SQLQuery1['fullname'], Self);
ListView1.AddItem('Country: '+SQLQuery1['cntry'], Self);
// move to the next record
SQLQuery1.Next;
end;
しかし、私は次のようなものが欲しいです:
