B
badboyzhang5205
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button9Click(Sender: TObject);
var
FilterText:string;
begin
Adotable4.Close;
Adotable4.Filtered:=false;
filterText:='Sex='+ QuotedStr(combobox2.Text)
+'and'+'politics='+ QuotedStr(combobox3.Text)
+'and'+'class='+ QuotedStr(Edit3.Text)
+'and'+'major='+ QuotedStr(combobox1.Text);
AdoTable4.Filter:=FilterText;
Adotable4.Filtered:=true;
Adotable4.Open;
end;
说明: 我想用一个按钮实现单表复合查询,条件区为combobox1,combobox2,combobox3
和Edit3.数据库组件adoTable,datasourse。如果通过button9 把这几个条件并(and)起来
查询???上面那段是自已想的,可以通过编译,不过真正查询时出错
谁能尽快给我答复[?]
var
FilterText:string;
begin
Adotable4.Close;
Adotable4.Filtered:=false;
filterText:='Sex='+ QuotedStr(combobox2.Text)
+'and'+'politics='+ QuotedStr(combobox3.Text)
+'and'+'class='+ QuotedStr(Edit3.Text)
+'and'+'major='+ QuotedStr(combobox1.Text);
AdoTable4.Filter:=FilterText;
Adotable4.Filtered:=true;
Adotable4.Open;
end;
说明: 我想用一个按钮实现单表复合查询,条件区为combobox1,combobox2,combobox3
和Edit3.数据库组件adoTable,datasourse。如果通过button9 把这几个条件并(and)起来
查询???上面那段是自已想的,可以通过编译,不过真正查询时出错
谁能尽快给我答复[?]