Hi
Nein nicht über den zähler der ID
Delphi-Quellcode:
function TDM.getNextID(TableName: String): Integer;
var s : string;
begin
if TableName = 'Tour' then
s := 'SELECT max(TourNr) as TourNr FROM ''Tour.db''';
TourQ.Close;
TourQ.SQL.Text := s;
TourQ.Open;
result := TourQ.FieldbyName('TourNr').AsInteger + 1;
TourQ.Open;
end;
procedure TDM.TourAfterInsert(DataSet: TDataSet);
begin
Tour.FieldByName('TourNr').AsInteger := getNextID('Tour');
end;
Mfg
Uwe 111