Subject Duplicate a record
Author Harald Klomann
Hi,

I want to append a new record, with the all the values assigned from the current record in a grid.
My code works with IBO 3.6x, but with IBO 4.x the LookupKeyForBufferFields method defined as private,
so nore more useable. Also I canĀ“t just assign rowdata, because I use blobs. Any recommendations ?


procedure TfrmDemo.Button1Click(Sender: TObject);
var i:integer;
begin
with IB_Query1 do begin
i := FieldByName('ID').AsInteger;
Append;
KeyFields.ByName('ID').AsInteger := i;
if LookupKeyForBufferFields then begin
for i := 0 to FieldCount-1 do Fields[i].Assign(BufferFields[i]);
post
end;
end;
end;


Thanks
Harald Klomann