W
wooiguo
Unregistered / Unconfirmed
GUEST, unregistred user!
把过滤结果建成临时表,出来的临时表是过滤前的所有记录,请教如何解决?
with adoquery1 do
begin
close;
with sql do
begin
clear;
text:='select distinct itemno into temptable1 from bom1';
end;
ExecSQL;
end;
之前已经用filterrecord事件过滤.
3868474提供的解决办法:
with adoquery1 do
begin
close;
sql.text:='select itemno into temptable1 from bom1 where 1 = 2'; //建立表
execSQL;
close;
sql.text := ' select * from temptable1 '; //bom1改成了temptable1
open;
end;
with qry do
begin
first;
while not eof do
begin
adoquery1.append;
adoquery1.fieldByName('itemno').asString := fieldByName('itemno').asstring;
adoquery1.post;
next;
end;
end;
with adoquery1 do
begin
close;
with sql do
begin
clear;
text:='select distinct itemno into temptable1 from bom1';
end;
ExecSQL;
end;
之前已经用filterrecord事件过滤.
3868474提供的解决办法:
with adoquery1 do
begin
close;
sql.text:='select itemno into temptable1 from bom1 where 1 = 2'; //建立表
execSQL;
close;
sql.text := ' select * from temptable1 '; //bom1改成了temptable1
open;
end;
with qry do
begin
first;
while not eof do
begin
adoquery1.append;
adoquery1.fieldByName('itemno').asString := fieldByName('itemno').asstring;
adoquery1.post;
next;
end;
end;