2,497
社区成员
发帖
与我相关
我的任务
分享
procedure TForm1.Button1Click(Sender: TObject);
var T:string;
begin
if edit1.Text <> '' then
begin
T:=' and t.name like ''' +'%'+edit1.Text+'%'+ ''' ' ;
end;
if edit2.Text <> '' then
begin
T:= T + ' and t.about like ''' +'%'+edit2.Text+'%'+ ''' ' ;
end;
if edit3.Text <> '' then
begin
T:= T + ' and t.about1 like ''' +'%'+edit3.Text+'%'+ ''' ' ;
end;
with adoquery1 do
begin
close;
sql.Clear;
sql.Text:=('select t.name,t.about,t.about1 from tpl_word1 t where t.wordtype <> '' ''' + T + ''' ') ;
open;
end;
end;