procedure TFahrplan.Btn_beschriftenClick(Sender: TObject);
var FP, pos, u: Word;
Fahrplan_PM, Fahrplan : String;
DBFehler, Absender,Ziel,Alter,Fehler,Info,SP_FK,Field : LongInt;
begin
Field := 1;
Absender := 1;
Ziel := 1;
Alter:= 1;
Fehler:= 1;
Info := 1;
SP_FK := 1;
//
mssql.ClientDataSet.Edit;
for FP := 1 to StrToInt(Edit1.Text) do begin
Fahrplan_PM := '';
case FP of
1..9 : Fahrplan := 'FP0' + IntToStr(FP);
10..100 : Fahrplan := 'FP' + IntToStr(FP);
end;
for u := 1 to 2 do begin
for pos := 1 to 50 do begin
case pos of
1..9 : Fahrplan_PM := Fahrplan + '_U' + IntToStr(u) + '_Pos0' + IntToStr(pos);
10..50: Fahrplan_PM := Fahrplan + '_U' + IntToStr(u) + '_Pos' + IntToStr(pos);
end;
mssql.ClientDataSet.AppendRecord ([ Fahrplan_PM,Fahrplan,0,0,0,0,0,0]);
end;
end;
end;
DBFehler :=
mssql.ClientDataSet.ApplyUpdates(0);
end;
procedure TFahrplan.FormActivate(Sender: TObject);
begin
if
mssql.ClientDataSet.Active then
mssql.ClientDataSet.Close;
mssql.SQLDataSet.CommandText := 'select * from Fahrplan';
mssql.ClientDataSet.Open;
mssql.ClientDataSet.Active := true;
DS_FahrPos.Enabled := true;
mssql.FMetaDataProvider := TDBXDataExpressMetaDataProvider.Create;
end;