Einzelnen Beitrag anzeigen

Kleine

Registriert seit: 27. Apr 2011
40 Beiträge
 
Delphi 2009 Professional
 
#11

AW: Sql-Befehl anpassen

  Alt 6. Mai 2011, 11:26
I hoabs jet
Delphi-Quellcode:
function TFormMain.MaxUnivID(tb: string): Integer;
var
  lMax : Integer ;
begin
    qu.Close ;
    qu.SQL.Clear ;
    qu.SQL.Add( Format( 'Select max(ID) as MaxID from %s', [ tb ] ) ) ;
    qu.Open ;
    lMax := qu.FieldByName('MaxID').AsInteger;
    Result := lMax ;
end;
Lg Kleine
  Mit Zitat antworten Zitat