如果APPEND前要进行复杂校对 那就用下面的方法:
function AppendData(var SourTable ,TargetTable :Ttable):boolean; //将SourTable 导入TargetTable.
var
FieldVal1,FieldVal2...FieldValn :string;
begine
SourTable.open;
TargetTable.open;
TargetTable.indexName := ....要设置索引哟.
SourTable.bof();
while not SourTable.eof() do
begin
FieldVal1:= SourTable.FieldByName('field1').asstring ;
FieldVal2:= SourTable.FieldByName('field2').asstring ;
...
if TargetTable.FindKey(....) = false
beign
TargetTable.append()
TargetTable.FieldByName( ' ...) := ...
TargetTable.FieldByName( ' ...) := ...
TargetTable.FieldByName( ' ...) := ...
TargetTable.post;
end;
SourTable.next;
end;
result := ...
end;
要是不放心再加上异常处理.....