var row:integer; sqlstr,sqlstr2:String;begin ASG2.ScrollBars:=ssNone;
ASG2.RowCount := 1; //表格为空
row:=ASG2.rowcount-1;
sqlstr:='select * from Ta where 1=1 ';
if Et1.Text<>'' then begin //sqlstr2:='%'+Et1.Text+'%'; sqlstr:=sqlstr+' and UPPER(KHMC) like UPPER('+QuotedStr('%'+Et1.Text+'%')+')'; end;
EditFDA(FTEMP,'Ta',0); //0 要 commit; 1 直接修改
FTEMP.Close; // FTEMP.SQLS.SelectSQL.Text:=sqlstr; FTEMP.Open;
while not FTEMP.Eof do begin
ASG2.rowcount :=ASG2.rowcount+1; //增加 一行 空行 row:=row+1; //行 值
ASG2.Cells[1,row]:= FTEMP.fieldbyname('KHMC').asstring;
FTEMP.Next; end;
ASG2.AutoNumberCol(0); //自动序号
ASG2.ScrollBars:=ssBoth;
end;