AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

search in database

Ein Thema von mohfa · begonnen am 22. Jul 2007 · letzter Beitrag vom 22. Jul 2007
 
mohfa

Registriert seit: 11. Feb 2007
97 Beiträge
 
Delphi 7 Enterprise
 
#1

search in database

  Alt 22. Jul 2007, 11:03
i really need your help in this :

i have table contains 3 fields :
1st Field : Id ( integer )
2nd Field : Categ ( string )
3rd Field : Name ( String )

i'd like to seach the 3rd Field for a string , if the result is True then
Display the result in a TListView like this :
ID | Categ | Name


i did it like this
Delphi-Quellcode:
ListView.Items.Clear;
if Found then // yes we find the searched word

begin

  With MyTable do
  begin
      Close;
  
      Open;
      first;
    while not EOF do
   begin
     ListView1.Items.AddItem(nil);
     ListView1.Items[ListView1.Items.Count-1].Caption := FieldByName('ID').AsString;
     ListView1.Items[ListView1.Items.Count-1].SubItems.Add(FieldByName('Categ').AsString);
     Next;
     end;

the problem here is that all records will be displayed , But i want only the found record to be displayed.


thanks
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:28 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz