1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36:
| procedure TForm15.FormShow(Sender: TObject); var mandant_alt_id: integer; mandant_neu_id: integer; mandant_alt_name: string; mandant_neu_name: string; counter_leistung, counter_vers,counter_summe: integer; begin mandant_alt_id := getMandantId(edit1.Text); mandant_neu_id := getMandantid(edit2.Text);
adodataset1.CommandText := 'select count(*) from leistung where mandant = '+inttostr(mandant_alt_id); adodataset1.Active := true; counter_leistung:= strtoint(adodataset1.FieldByName('count(*)').Text); adodataset1.Next; adodataset1.Close;
counter_summe := counter_leistung+counter_vers;
progressbar1.Max := counter_summe;
adodataset1.CommandText := 'select name,kurzname,preis,mandant,nr from leistung where mandant = '+inttostr(mandant_alt_id); adodataset1.Active := true; while not (adodataset1.Eof) do begin Application.ProcessMessages; adocommand1.CommandText := 'insert into leistung (name,kurzname,preis,mandant,nr) values ("'+adodataset1.FieldByName('name').Text+'","'+adodataset1.FieldByName('kurzname').Text+'",'+stringreplace(adodataset1.FieldByName('preis').Text,',','.',[rfReplaceAll])+','+inttostr(mandant_neu_id)+',"'+adodataset1.FieldByName('nr').Text+'")'; adocommand1.Execute; progressbar1.Position := progressbar1.Position +1; adodataset1.Next; end; adodataset1.Close;
end; |