var str:string; while not table1.eof do begin str:=copy(bh,1,3); table1.filtered:=false; table1.filter:=format('str'+'='+'''%s''',[999]); table1.filtered:=true; table1.next; end;
为什么不能用ADUQUERY控件实现呀? select * from table where bh like '999%' 不就可以了吗?
var str:string; while not table1.eof do begin str:=copy(bh,1,3); table1.filtered:=false; table1.filter:=format('str'+'='+'''%s''',[999]); table1.filtered:=true; table1.next; end;我试过了,提示出错,我将999换成变量也不行?
while not table1.eof do
begin
str:=copy(bh,1,3);
table1.filtered:=false;
table1.filter:=format('str'+'='+'''%s''',[999]);
table1.filtered:=true;
table1.next;
end;
……
后filtered=true;
我也想用ADOQuery来实现。。
select * from table where bh like '999%'
不就可以了吗?
while not table1.eof do
begin
str:=copy(bh,1,3);
table1.filtered:=false;
table1.filter:=format('str'+'='+'''%s''',[999]);
table1.filtered:=true;
table1.next;
end;我试过了,提示出错,我将999换成变量也不行?
取出编号前几位为'999'
filter:=copy(bh,1,3)+'=999';
我用这个不提示出错,但数据一个也取不出来。