+ -
当前位置:首页 → 问答吧 → 问一下 我该怎么改下面

问一下 我该怎么改下面

时间:2011-12-27

来源:互联网

if (RadioButton4.Checked= True ) then
  begin
  table1.Close;
  table1.Filter:=' ShopId >='+edit2.Text+' and ShopId =<'''+edit3.Text+''''+'and State=''营业''';
  table1.Filtered:=true;
  table1.Open;
  if table1.RecordCount=0 then
  begin
  showmessage('抱歉,没有你要找的序列号!!!');
  table1.Close ;
  table1.Filter:=' ShopId <>NULL';
  table1.Filtered:=true;
  table1.Open ;
  end;
  end;

作者: dswdwq   发布时间: 2011-12-27

table1.Open;
if RadioButton4.Checked then
begin
  table1.Filter:='ShopId >='+Quotedstr(edit2.Text)+' and ShopId <='+Quotedstr(edit3.Text)+' and State=''营业''';
  table1.Filtered:=true;
  if table1.RecordCount=0 then
  begin
  showmessage('抱歉,没有你要找的序列号!!!');
  table1.Filtered:=false;
  end;
end;

作者: kaikai_kk   发布时间: 2011-12-28

Delphi(Pascal) code

if (RadioButton4.Checked= True ) then
begin
  table1.Close;
  {其实用下面这个感觉比较清晰
  table1.Filter:=format('(ShopId >= %s) and (ShopId =< %s) and (State="营业")', [edit2.Text, edit3.Text]);}
  table1.Filter:='(ShopId >= '+edit2.Text+') and (ShopId =<'+edit3.Text+') and (State="营业")';
  table1.Filtered:=true;
  table1.Open;
  if table1.RecordCount=0 then
  begin
    showmessage('抱歉,没有你要找的序列号!!!');
    table1.Close ;
    table1.Filter:=' ShopId <>NULL';
    table1.Filtered:=true;
    table1.Open ;
  end;
end;

作者: imitator   发布时间: 2011-12-28

晕,ShopId到底是什么类型的啊?难道不是Integer吗?
怎么还有ShopId <> NULL...

作者: imitator   发布时间: 2011-12-28

热门下载

更多