Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Free Pascal
»
Database
(Moderators:
FPK
,
Tomas Hajny
) »
filtered dbgrid
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
WIKI Timeout issues
Please read here if you have trouble connecting to the wiki
Recent
IBX 2.7.2.1650 Bug?
by
incendio
[
Today
at 02:09:59 am]
Where to download IBX pre...
by
incendio
[
Today
at 01:37:39 am]
Strict Aliasing Rule
by
nixbody
[
Today
at 01:30:18 am]
Lazarus 4, What's wrong w...
by
incendio
[
Today
at 12:48:54 am]
Component to manage short...
by
EganSolo
[
Today
at 12:36:36 am]
Replace controls dynamica...
by
Aruna
[June 18, 2025, 11:58:42 pm]
[SOLVED] Which RTL Unit d...
by
tfurnivall
[June 18, 2025, 10:25:01 pm]
CEF component - the first...
by
wp
[June 18, 2025, 08:21:11 pm]
slim installation by remo...
by
wp
[June 18, 2025, 08:19:09 pm]
Crash on changing a strin...
by
Martin_fr
[June 18, 2025, 08:11:34 pm]
How to stop macro executi...
by
Martin_fr
[June 18, 2025, 08:06:44 pm]
Layout problem by nested ...
by
etrusco
[June 18, 2025, 07:55:44 pm]
Build failure
by
user5
[June 18, 2025, 07:42:34 pm]
Loading an image from an ...
by
Fred vS
[June 18, 2025, 06:29:01 pm]
IDE Lazarus 4.0 on Window...
by
Martin_fr
[June 18, 2025, 03:47:30 pm]
Lazarus 4.0 RC3
by
paxnet_be
[June 18, 2025, 02:34:23 pm]
Firebird 5 remote login v...
by
LacaK
[June 18, 2025, 02:07:34 pm]
Compile errors in MacBook...
by
Thaddy
[June 18, 2025, 11:46:06 am]
LAMW - UTF-8 character in...
by
Alcatiz
[June 18, 2025, 11:36:29 am]
How to run an external pr...
by
vsajip
[June 18, 2025, 08:50:34 am]
lazbuild command line swi...
by
n7800
[June 18, 2025, 04:21:35 am]
dBGRidController and Erro...
by
essence-ciel
[June 18, 2025, 01:15:11 am]
"LCLVersion" in *.lfm fil...
by
zeljko
[June 17, 2025, 11:05:36 pm]
FPC for high-performance ...
by
Thaddy
[June 17, 2025, 09:42:33 pm]
x86_64-win64 annoys me
by
Nicole
[June 17, 2025, 08:28:16 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: filtered dbgrid (Read 4365 times)
cryptid
Newbie
Posts: 3
filtered dbgrid
«
on:
April 01, 2021, 11:23:41 am »
filter db grid not work
procedure TForm1.Edit1Change(Sender: TObject);
begin
SQLQuery1.Filtered:=False;
SQLQuery1.Filter:='name' + 'LIKE' + QuotedStr(Edit1.Text );
SQLQuery1.Filtered:=True;
end;
Logged
wp
Hero Member
Posts: 12864
Re: filtered dbgrid
«
Reply #1 on:
April 01, 2021, 11:49:19 am »
Without spaces around 'LIKE' the three parts in your filter text, 'name', 'LIKE', condition, will not be separate words.
Logged
Joek
New Member
Posts: 27
Re: filtered dbgrid
«
Reply #2 on:
April 02, 2021, 05:26:18 pm »
A small example: this works for me with LIKE ...
Code: Pascal
[Select]
[+]
[-]
procedure
TFOhlaseni
.
FilterKodChange
(
Sender
:
TObject
)
;
var
sImput
:
string
;
begin
sImput
:
=
FilterKod
.
Text
;
DMOhlaseni
.
DSIBOhlaseni
.
Filtered
:
=
false
;
DMOhlaseni
.
DSIBOhlaseni
.
Filter
:
=
'KOD_OHLASENI LIKE '
+
QuotedStr
(
sImput
+
'%'
)
;
DMOhlaseni
.
DSIBOhlaseni
.
Filtered
:
=
true
;
end
;
Logged
flori
Full Member
Posts: 196
Re: filtered dbgrid
«
Reply #3 on:
April 07, 2021, 02:58:22 pm »
Code: Pascal
[Select]
[+]
[-]
SQLQuery1
.
Active
:
=
false
;
SQLQuery1
.
SQL
.
Clear
;
SQLQuery1
.
SQL
.
Append
(
'select * from log WHERE user LIKE '
''
+
edit1
.
Text
+
'%'
''
)
;
SQLQuery1
.
Active
:
=
true
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Free Pascal
»
Database
(Moderators:
FPK
,
Tomas Hajny
) »
filtered dbgrid
TinyPortal
© 2005-2018