全局变量
var
vtRec: Variant;
在beforeinsert事件中写入
var
i: Integer;
begin
if DataSet.IsEmpty then
Exit;
if VarIsEmpty(vtRec) then
vtRec := varArrayCreate([0, DataSet.FieldCount - 1], varVariant)
else
VarArrayRedim(vtRec, DataSet.FieldCount - 1); //Resize the variant array.
RecDataSet := DataSet;
for i := 0 to DataSet.FieldCount - 1 do
vtRec := DataSet.Fields.Value;
end;
在afterinsert中写
var
i: Integer;
begin
if (VarIsEmpty(vtRec)) then
exit;
for i := 0 to DataSet.FieldCount - 1 do
DataSet.Fields.Value := vtRec;
end;
100分,嘻嘻