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
| TFichSt = class(TForm)
DSst: TDataSource;
Tbst: TTable;
DBGst: TDBGrid;
DBNavst: TDBNavigator;
Labst: TLabel;
....
procedure TFichSt.TbCreat(NomTab, TitreFic : string); // création d'un enreg
begin
Tbst.TableName := NomTab; // nom de la table
Caption := TitreFic; // titre de la fenêtre
TbSt.Active := False;
TbSt.ReadOnly := False;
try
LabSt.Caption := 'CREATION d''une LIGNE';
DBNavSt.VisibleButtons := [nbFirst,nbPrior,nbNext,nbLast,nbInsert,
nbCancel,nbPost];
TbSt.Active := True;
TbSt.Last;
ShowModal;
finally
DBGst.Enabled := True;
TbSt.ReadOnly := True;
TbSt.Close;
Tbst.TableName := '';
end;
end; |
Partager