R
rixin
Unregistered / Unconfirmed
GUEST, unregistred user!
parambyname 中的sels作為數組變量, 是否可以?
...
i:=0;
with QueryPtCKST do
begin
close;
SQL.Clear;
SQL.Add('select a.stuffno,a.stuffname,a.unit,');
SQL.Add('b.stuqty,b.ckqty');
SQL.Add('from "/royalsys/rst/rsdata.dbf" a,');
SQL.Add('"/royalsys/rst/rnstock.dbf" b');
SQL.Add('where a.stuffno=b.stuffno');
SQL.Add('and (a.stuffno like :seletM');
parambyname('seletM').asstring:=SelectPrint+'%';
i:=1;
////
while SelectPrint<>'' do
begin
SQL.Add('or a.stuffno like :sels');
sels:=inttostr(i); //**** 不起作用 ****
parambyname('sels').asstring:=SelectPrint+'%';
i:=i+1;
end;
////
SQl.Add(') order by a.stuffno');
open;
end;
....
...
i:=0;
with QueryPtCKST do
begin
close;
SQL.Clear;
SQL.Add('select a.stuffno,a.stuffname,a.unit,');
SQL.Add('b.stuqty,b.ckqty');
SQL.Add('from "/royalsys/rst/rsdata.dbf" a,');
SQL.Add('"/royalsys/rst/rnstock.dbf" b');
SQL.Add('where a.stuffno=b.stuffno');
SQL.Add('and (a.stuffno like :seletM');
parambyname('seletM').asstring:=SelectPrint+'%';
i:=1;
////
while SelectPrint<>'' do
begin
SQL.Add('or a.stuffno like :sels');
sels:=inttostr(i); //**** 不起作用 ****
parambyname('sels').asstring:=SelectPrint+'%';
i:=i+1;
end;
////
SQl.Add(') order by a.stuffno');
open;
end;
....