Autor Beitrag
oPPi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 66

MS Win 7 Pro, WinXP Pro
D3 Pro, TurboDelhi, Kylix 3 Pro
BeitragVerfasst: Fr 23.08.02 13:43 
Hallo,

wie kann ich überprüfen ob sich in einer vorhanden Tabelle schon Datensätze befinden.
Wenn keine Daten vorhanden sind soll mir ne Meldung (z.B. ShowMessage oder so) ausgegeben werden.

Gruß

oPPi

_________________
... Manchmal kommt man nicht auf die einfachsten Sachen obwohl
die Lösung ganz nah liegt ...
ao
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 145

Win XP Prof.
D7 Ent.
BeitragVerfasst: Fr 23.08.02 13:58 
Hallo oPPI,

versuchs mal so:
ausblenden Quelltext
1:
2:
3:
4:
5:
Query.Close; 
Query.SQL.Clear; 
Query.SQL.Add('SELECT * FROM DeineTabelle'); 
Query.Open;
if Query.IsEmpty then ShowMessage('Deine Tabelle ist leer.');

Gruß
Andreas
Renegade
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 358

Win XP Pro, Win 7 Beta
BDS 2006
BeitragVerfasst: Fr 23.08.02 15:25 
oder probier's mal so

ausblenden Quelltext
1:
If Table1.RecordCount=0 then ...					


Gruß Renegade

_________________
Sokrates (468 v.Chr. - 399 v.Chr.)
"Es ist keine Schande, nichts zu wissen, wohl aber, nichts lernen zu wollen."
Steffer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 299



BeitragVerfasst: Fr 23.08.02 18:50 
if Table.IsEmpty ...

_________________
Keine Signatur ...