ListView1.Items.Clear; ADOQuery1.close; ADOQuery1.sql.clear; ADOQuery1.sql.add('select * from Employees'); ADOQuery1.Open; while not ADOQuery1.eof do begin with ListView1.items.add do begin caption:=ADOQuery1.FieldByName('EmployeeID').AsString; subitems.add(ADOQuery1.FieldByName('FirstName').AsString); subitems.add(ADOQuery1.FieldByName('lastname').AsString); subitems.add(ADOQuery1.FieldByName('Title').AsString); end; ADOQuery1.Next; end;
效果: