Tdbf problem with partial search lazarus / 16-Databases ---------------------------------------------------------------------- ensimek · 2009-01-18 10:23 Hi, I've problem with partial search on dBase. My code: ------------------------------------------------------------------- procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: char); var   wpisane: string;   szukane: string; begin   wpisane := '%'+Form1.Edit1.Text+'%';   Label3.Caption := wpisane;   if wpisane <> '' then szukane := 'IMIE = ''' + wpisane + '''' + ' OR ' + 'NAZWISKO = ''' + wpisane + '''' + ' OR ' + 'PSEUDONIM = ''' + wpisane + '''' + ' OR ' + 'PESEL = ''' + wpisane + '''' + ' OR ' + 'ADRES = ''' + wpisane + '''' + ' OR ' + 'TELEFON = ''' + wpisane + '''' + ' OR ' + 'POJAZD = ''' + wpisane + '''' + ' OR ' + 'KONTAKTY = ''' + wpisane + '''' + ' OR ' + 'UWAGI = ''' + wpisane + '''';   if szukane <> '' then   begin     myDbf.Filter := szukane;     myDbf.Filtered := True;   end;   if wpisane = '' then myDbf.Filtered := False; end;                    ------------------------------------------------------------------- Part of database: ID      IMIE      NAZWISKO      PSEUDONIM      PESEL      ADRES      TELEFON      POJAZD 1       Tomek   Poziomek         tomeq             6542341                514123223 2       Iwona    Mazanek         iskierka            1234567                                 Renault Megane 3       Lomek    Istrzyk And now, why? when I write 'mek' in Edit1, i'am getting no result when i should get results 1 and 3? Where am I wrong? ---------------------------------------------------------------------- ensimek · 2009-01-18 21:24 nobody has a solution? ;( ---------------------------------------------------------------------- Loesje · 2009-01-18 21:28 Maybe you should try with a search one one field, for example imei. See if that works. (remove all other or'ed comparisions) It could be that you have to add some parentheses. (a=b) or (c=b) or (...) etc.. ---------------------------------------------------------------------- arnix · 2009-01-19 10:16 And also try to use LIKE instead of "=". For example SELECT * FROM tbl WHERE my_fld LIKE '%123%' ---------------------------------------------------------------------- ensimek · 2009-01-19 14:30 i tired 'LIKE' but told me that there's no LIKE in dbf database :/