RTC Forums

Subscription => Support => Topic started by: Walter on November 25, 2009, 11:14:12 PM



Title: Small correction to "Copy TDataSet into rtc_DataSet"
Post by: Walter on November 25, 2009, 11:14:12 PM
Just a couple of unnecessary lines.  (A bit of Cut and Paste leftovers!)
Two nice functions!  Thanks.

See two lines commented out.


How to copy data from a TDataSet into a rtc_DataSet object?
<..snip..>
 if ClearFieldDefs then
  begin
    rtcDS.Clear;
    for flds := 0 to DelphiDS.FieldCount - 1 do
    begin
      fdef := DelphiDS.FieldDefs.Items[flds];
      fldname := fdef.Name;

     // field := DelphiDS.FindField(fldname);    <<<<<<<<<<<<<
     // if assigned(field) then                       <<<<<<<<<<<<<
     
     rtcDS.SetField(fldname,
       RTC_DB2FIELD_TYPE[fdef.DataType],
       fdef.Size,
       fdef.Required);
    end;
  end;

<..snip..>



Title: Re: Small correction to "Copy TDataSet into rtc_DataSet"
Post by: D.Tkalcec (RTC) on November 26, 2009, 12:08:58 AM
Thank you for your feedback.

I've updated the article now (removed the 2 unnecessary lines).

Best Regards,
Danijel Tkalcec