Recent

Author Topic: SQLite3 filter and FindFirst/FindNext  (Read 4505 times)

JanRoza

  • Hero Member
  • *****
  • Posts: 585
    • http://www.silentwings.nl
SQLite3 filter and FindFirst/FindNext
« 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
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Laz: Lazarus 2.0.10 FPC 3.2.0
       CodeTyphon 7.2 FPC 3.3.1

LuizAmérico

  • Sr. Member
  • ****
  • Posts: 458
RE: SQLite3 filter and FindFirst/FindNext
« Reply #1 on: December 18, 2007, 11:07:00 am »
Filter is not implemented in SqliteDataset.
Use Locate/LocateNext instead.

JanRoza

  • Hero Member
  • *****
  • Posts: 585
    • http://www.silentwings.nl
SQLite3 filter and FindFirst/FindNext
« Reply #2 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
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Laz: Lazarus 2.0.10 FPC 3.2.0
       CodeTyphon 7.2 FPC 3.3.1

 

TinyPortal © 2005-2018