Subject | Trouble posting changes to a multirecord dataset |
---|---|
Author | myzebuisbrown |
Post date | 2006-11-01T01:44:52Z |
Hi,
I'm working on a large application that does all of it's saving one
record at a time. Basically the code is like this.
Dataset.Close;
Dataset.ParamByName('ACTIVITY_ID').AsInteger := ActivityId;
Dataset.Open;
Dataset.Edit;
Dataset.FieldByName('WS_REPEAT_REASON').AsString := RepeatReason;
Dataset.Post;
This may be called up to 12000 times in one "Save". Hence saving is
currently extremely slow. I am looking to speed this up and have
tried the following
While not Dataset.eof do begin
{ does not load activities which have been repeated }
Dataset.Edit;
Dataset.FieldByName('WS_REPEAT_REASON').AsString := RepeatReason;
Dataset.Post;
Dataset.Next;
break;
end;
In this case "Dataset" is a TIB_Cursor containing all the records that
need to be modified. The trouble is this code doesn't seem to modify
the records in the db. Can anyone help please?
Thanks,
Thomas Johnson
I'm working on a large application that does all of it's saving one
record at a time. Basically the code is like this.
Dataset.Close;
Dataset.ParamByName('ACTIVITY_ID').AsInteger := ActivityId;
Dataset.Open;
Dataset.Edit;
Dataset.FieldByName('WS_REPEAT_REASON').AsString := RepeatReason;
Dataset.Post;
This may be called up to 12000 times in one "Save". Hence saving is
currently extremely slow. I am looking to speed this up and have
tried the following
While not Dataset.eof do begin
{ does not load activities which have been repeated }
Dataset.Edit;
Dataset.FieldByName('WS_REPEAT_REASON').AsString := RepeatReason;
Dataset.Post;
Dataset.Next;
break;
end;
In this case "Dataset" is a TIB_Cursor containing all the records that
need to be modified. The trouble is this code doesn't seem to modify
the records in the db. Can anyone help please?
Thanks,
Thomas Johnson