Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » DBISAM Technical Support » Incident Reports » Incident Reports Addressed for Version 2.06 » View Incident Report |
Serious |
Reported By: Ronnie Burns Reported On: 12/5/2000 For: Version 2.05 Build 1 |
procedure CopyDataSet(Source: TDBIsamQuery; Dest: TDBIsamTable); var x, y, iRecNo, iCnt, iCutCnt: Integer; HoldField: TField; RecNoField: TField; TypeArray: array[0..200] of TFieldType; FieldArray: array[0..200] of TField; begin iRecNo := 0; iCnt := 0; RecNoField := Dest.FindField('RecNo'); MainStatusPanel.Caption := '0 Rows Loaded ...'; Application.ProcessMessages; Dest.DisableControls; // Let's fill the field array with our destination fields. for x := 0 to Source.FieldCount -1 do begin FieldArray[x] := Dest.FindField(Source.Fields[x].FieldName); if FieldArray[x] <> nil then TypeArray[x] := FieldArray[x].DataType; end; try with Source do begin while not Eof do begin Dest.Insert; for x := 0 to FieldCount -1 do if FieldArray[x] <> nil then case TypeArray[x] of ftInteger: TIntegerField(FieldArray[x]).Value := Fields[x].AsInteger; ftCurrency: TCurrencyField(FieldArray[x]).Value := Fields[x].AsCurrency; ftDate: TDateField(FieldArray[x]).Value := Fields[x].AsDateTime; ftString: TStringField(FieldArray[x]).Value := Fields[x].AsString; end; if RecNoField <> nil then begin inc(iRecNo); RecNoField.AsInteger := iRecNo; end; Dest.Post; inc(iCnt); if (iCnt mod 1000) = 0 then begin MainStatusPanel.Caption := FormatFloat('#, ##0', StrToFloat(IntToStr(iCnt))) ' Rows Loaded . ..'; Application.ProcessMessages; end; next; end; end; finally Dest.First; Dest.EnableControls; MainStatuspanel.Caption := ''; end; end;
This web page was last updated on Wednesday, March 20, 2024 at 07:22 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |