Lazarus

Programming => Databases => Topic started by: JanRoza on December 16, 2007, 08:46:37 pm

Title: SQLite3 filter and FindFirst/FindNext
Post by: JanRoza on December 16, 2007, 08:46:37 pm
I already search the forum for SQLite examples but alas there aren't too many.
In my program I have an Edit-box where the user can enter a value to be searched in the SQLite database. When found the dbgrid should be positioned on the found record.
I used following construction to do a search:

Code: [Select]

   tblAdressen.Filter := 'Lower(VolleNaam) like ''%' + LowerCase(EdtZoeken.Text) + '%''';
   if not tblAdressen.FindFirst
   then begin
           ..........
   end;


Unfortunately every search comes back empty although I know for sure the value is in the database.
Am I using a wrong syntax here?
How to search the SQLite database and get the dbgrid positioned on the found record?

Jan
Title: RE: SQLite3 filter and FindFirst/FindNext
Post by: LuizAmérico on December 18, 2007, 11:07:00 am
Filter is not implemented in SqliteDataset.
Use Locate/LocateNext instead.
Title: SQLite3 filter and FindFirst/FindNext
Post by: JanRoza on December 18, 2007, 12:46:45 pm
Thank you Luiz,

Once more you're my rescue in desperate times  :D
I'll switch to locate and try that way.

If I continue this long enough than one day there won't be anything left to ask about SQLite  :lol:

Jan
TinyPortal © 2005-2018