X
xbdliyu
Unregistered / Unconfirmed
GUEST, unregistred user!
我用adoQuery 放在循环里执行insert,不管最后是否excesql,内存泄漏严重.
for i:=0 to sg1.RowCount-1 do
begin
s:='';
Q3.Close;
Q3.SQL.Clear;
Q3.SQL.Add('insert into LSWLDW(LSWLDW_WLDWBH,LSWLDW_DWMC,LSWLDW_JC,LSWLDW_DQBH,LSWLDW_DWLB,LSWLDW_DWXZ,LSWLDW_NBDW,LSWLDW_TYBZ,layer,Isdetail,BestShipPoint,ShipToPoint,LSWLDW_QSRQ) ');
Q3.SQL.Add('values('''+DWQZ+sg1.Cells[0,i]+''','''+sg1.Cells[1,i]+''','''',');
Q3.SQL.Add(''''+s+''','''+DWQZ+sg1.Cells[2,i]+''',''11'',''0'',''0'',1,''1'','''','''',');
Q3.SQL.Add(''''+copy(ND,1,4)+'0101'')');
Q3.ExecSQL;
Q3.SQL.Clear;
Q3.Close;
end;
for i:=0 to sg1.RowCount-1 do
begin
s:='';
Q3.Close;
Q3.SQL.Clear;
Q3.SQL.Add('insert into LSWLDW(LSWLDW_WLDWBH,LSWLDW_DWMC,LSWLDW_JC,LSWLDW_DQBH,LSWLDW_DWLB,LSWLDW_DWXZ,LSWLDW_NBDW,LSWLDW_TYBZ,layer,Isdetail,BestShipPoint,ShipToPoint,LSWLDW_QSRQ) ');
Q3.SQL.Add('values('''+DWQZ+sg1.Cells[0,i]+''','''+sg1.Cells[1,i]+''','''',');
Q3.SQL.Add(''''+s+''','''+DWQZ+sg1.Cells[2,i]+''',''11'',''0'',''0'',1,''1'','''','''',');
Q3.SQL.Add(''''+copy(ND,1,4)+'0101'')');
Q3.ExecSQL;
Q3.SQL.Clear;
Q3.Close;
end;