Fiblus+TMSgrid+FireBird用法

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;

posted @ 2011-02-18 21:54  阳光不远  阅读(465)  评论(1编辑  收藏  举报