下面是部分源代码,程序是执行到post处停止响应的。
with Table2 do
begin
First;
while not Eof do
begin
try
if abort = 1 then
begin
Form1.ListBox1.Items.Add(' ');
Form1.ListBox1.Items.Add('数据导入程序中止' + DateTimeToStr(Now));
Form1.ListBox1.ItemIndex:=Form1.ListBox1.Items.Count-1;
MoniList := 1;
exit;
end;
pnum := '510700' + PCSDM + COPY(IntToStr(10000000 + FieldValues['H110']),2,7);
Remtab.SetKey;
Remtab.FieldByName('NUM').AsString := pnum;
if Remtab.GotoKey then
Remtab.Edit
else
Remtab.Append;
REmtab.FieldValues['GROUP_NO'] := IntToStr(FieldValues['I110']);
REmtab.FieldValues['GROUP_TYPE'] := FieldValues['A1100039'];
REmtab.FieldValues['RELATION'] := FieldValues['A1100049'];
REmtab.FieldValues['NAME'] := FieldValues['X1100059'];
REmtab.FieldValues['ONAME'] := FieldValues['A1100069'];
REmtab.FieldValues['SEX'] := FieldValues['A1100079'];
if Table1.Locate('h100',Table2.FieldByName('i110').value,[loCaseInsensitive]) then
begin
REmtab.FieldValues['STREET_OFFICE'] := Table1.FieldValues['A1000039'];
REmtab.FieldValues['STREET'] := Table1.FieldValues['A1000049'];
REmtab.FieldValues['ADDRESS'] := Table1.FieldValues['A1000059'];
end;
REmtab.FieldValues['BIRTH_DATE'] := FormatDateTime('yyyymmdd',FieldByName('A1100089').AsDateTime);
REmtab.FieldValues['BIRTH_SIGNDATE'] := FormatDateTime('yyyymmdd',FieldByName('A1100429').AsDateTime);
REmtab.FieldValues['ID_SIGNDATE'] := FormatDateTime('yyyymmdd',FieldByName('A1100249').AsDateTime);
REmtab.FieldValues['COME_DATE'] := FormatDateTime('yyyymmdd',FieldByName('A1100339').AsDateTime);
try
REmtab.Post;
except
REmtab.Cancel;
end;
Next;
except
on E: Exception do
begin
try
REmtab.Post;
except
REmtab.Cancel;
end;
Next;
end;
end;
end;
end;