adodatasetdest.commandtext := format(‘select * from %s where 1=
adodatasetdest.open;
adodatasetdest.insert;
for i:=0 to fieldlist.count-1 do
adodatasetdest.fields[i] := fields[i];
adodatasetdest.post;
end;
next;
end;
end;
// 判断指定主键值的记录在表中是否存在
function recordindest(strtablename, strkeyfieldname, strkeyvalue: string): boolean;
begin
with adoquery1 do
begin
close;
sql.clear;
sql.add(format(‘select count(*) from %s where %s=%s, [strtablename, strkeyfieldname, quotedstr(strkeyvalue)]));
open;
result := fields[0].asinteger > 0;
close;
end;
end;