var
iCount:integer;
Rs:ADOInt.Recordset;
ListItem:TListItem;
State:String;
begin
frmMain.lv1.Items.BeginUpdate;
frmMain.lv1.Items.Clear;
Rs:=ADOQuery1.Recordset;
for iCount:=1 to 100 do
begin
with frmMain do
begin
ListItem:=Lv1.Items.Add;
ListItem.Caption:=rs.Fields.Get_Item('ID').Value;
ListItem.SubItems.Add(rs.Fields.Get_Item('Subject').Value);
ListItem.SubItems.Add(rs.Fields.Get_Item('UserFrom').Value);
ListItem.SubItems.Add(rs.Fields.Get_Item('ReplyTimes').Value);
case rs.Fields.Get_Item('Status').Value of
0: State:= '待答';
1: State:= '讨论中';
2: State:= '已答';
else State := '其它';
end;
ListItem.SubItems.Add(State);
ListItem.SubItems.Add(rs.Fields.Get_Item('DateTime').Value);
ListItem.SubItems.Add(rs.Fields.Get_Item('Points').Value);
rs.MoveNext;
end;
end;
frmMain.lv1.Items.EndUpdate;