Autor Beitrag
is44c
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Do 23.03.06 17:08 
hi @ all

ich hab mir nen kleinen suchdruchlauf zusammen gebaut für meine datenbank.
der sieht wie folgt aus

ausblenden volle Höhe Delphi-Quelltext
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:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
procedure Tform_Hauptfenster.btn_sucheClick(Sender: TObject);
VAR counter : Integer;
begin
 table1.First;
 Counter :=0;
 if radio_nachname.Checked then
  begin
   repeat
    inc(counter);
    if dtxt_nachname.Text <> txt_suche.Text then
      table1.Next;
    if counter = table1.g then
     break;
   until dtxt_nachname.Text = txt_suche.Text;
  end;
 if radio_vorname.Checked then
  begin
   repeat
    if dtxt_vorname.Text <> txt_suche.Text then
      table1.Next;
    if dtxt_vorname.Text = '' then
     break;
   until dtxt_vorname.Text = txt_suche.Text;
  end;
 if radio_beitritt.Checked then
  begin
   repeat
    if dtxt_beitritt.Text <> txt_suche.Text then
      table1.Next;
    if dtxt_beitritt.Text = '' then
     break;
   until dtxt_beitritt.Text = txt_suche.Text;
  end;
 if radio_nummer.Checked then
  begin
   repeat
    if dtxt_mitgliedsnummer.Text <> txt_suche.Text then
      table1.Next;
    if dtxt_mitgliedsnummer.Text = '' then
     break;
   until dtxt_mitgliedsnummer.Text = txt_suche.Text;
  end;
end;


zur Erklärung:

radio_(platzhalter) sind RadioButtons
dtxt_(Platzhalter) sind DBEdits
table1 ist meine Datenbank
txt_Suche ist ein Edit und dort wird mein Suchebgriff eingegeben

Wenn ich jetzt eine suche Starte, lande ich in einer endlosschleife, sobald der suchbegriff nicht gefunden wird.

Kann mir jemand nen tipp geben??

mfg
is44c

Moderiert von user profile iconGausi: Code- durch Delphi-Tags ersetzt
counterto
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 123

Win XP
Delphi 2005 Prof., Visual Basic 2005, PHP, My Sql, Visual Basic 6
BeitragVerfasst: Do 23.03.06 17:26 
vielleicht anstatt "break" was anderes? stopp? Aber mit break geht es normal!

_________________
Computer werden den Menschen immer ähnlicher - sie können bald alles, außer denken.
afk
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 102

Win 2K, Win XP
Delphi 2006 Arch., Delphi 6 Ent., MS-SQL 2005 & 2000
BeitragVerfasst: Do 23.03.06 20:24 
ausblenden Delphi-Quelltext
1:
until (dtxt_nachname.Text = txt_suche.Text) or table1.Eof;					

Gruß Axel

_________________
Man muß sparn wo mn knn !
is44c Threadstarter
Hält's aus hier
Beiträge: 12



BeitragVerfasst: Do 23.03.06 21:17 
Titel: DANKE
Ja danke mit tabel1.eof gehts!!!! Danke