Hello, dear members of the forum, I need help. In Delphi 7, I search the table by code.

procedure TForm2.Button1Click(Sender: TObject); begin if not Table1.Locate('Naimenov_ed', Edit1.Text,[loCaseInsensitive, loPartialKey]) then showmessage('нету такого') ; end; 

He finds the desired string, and how to remove the extra lines so that the one you are looking for remains? Or at least change the color of the desired line. Thanks in advance.

    3 answers 3

    See search and filtering data in Delphi .

    Painting a grid is a separate task, look for examples about the TDBGrid.OnDrawDataCell event (if another grid is used, you need to look for appropriate handlers for it), change the background or font color for the matching search records ... for example .

      Look about filtering. In general, I propose not a Table, but a Query component. Then, using SQL, this is not a problem at all.

        Then you have a more accurate task of filtering than searching for a value. True above say, use Query. Through SQL, it is easier to filter the necessary records.