仅供参考:
table1: 原表, table2: 更改表:
var
cells: array of array of String;
i,j,row,col:Integer;
begin
table1.open;
row:=table1.RecordCount;
col:=table1.FieldCount;
setLength(cells,row,col);
with table1 do begin
i:=1;
while not EOF do begin
cells[i,0]:=FieldByName['..'].AsString;
cells[i,1]:=FieldByName['..'].AsString;//注意类型匹配
......
Next;
end;
end;
table2.EmptyTable;
table2.open;
with table2 do begin
for i:=0 to row do begin
FielByName['xx'].AsInteger:=StrtoInt(cells[i,0]);
........
end;
end;
end;