解决ss:string; ss:=''; for I:=0 to k-1 do begin ss:=ss+''''+ mylist.Strings[i]+''''; if i<>j-1 then ss:=ss+','); end; with c_cgxqdfrm.jh_cgxqd do begin sql.Add('select a.lbmc,b.spmc,b.jldw,c.spsl'); sql.Add('from splbb as a,spmlb as b,xsdmxb as c'); sql.Add('where c.xsdh in (:xsdh) and c.spbh=b.spbh and a.lbbh=b.splb'); Parambyname('xsdh').Asstring:=ss; end;
ss:='';
for I:=0 to k-1 do
begin
ss:=ss+''''+ mylist.Strings[i]+'''';
if i<>j-1 then ss:=ss+',');
end; with c_cgxqdfrm.jh_cgxqd do
begin sql.Add('select a.lbmc,b.spmc,b.jldw,c.spsl');
sql.Add('from splbb as a,spmlb as b,xsdmxb as c');
sql.Add('where c.xsdh in (:xsdh) and c.spbh=b.spbh and a.lbbh=b.splb');
Parambyname('xsdh').Asstring:=ss;
end;