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
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How to avoid duplicates i...
by
mig-31
[
Today
at 05:35:46 pm]
TDWEdit
by
docno
[
Today
at 05:26:23 pm]
QGradientTrackPanel: A Fu...
by
Ed78z
[
Today
at 04:49:24 pm]
Memory location
by
Thaddy
[
Today
at 04:01:56 pm]
TurboBird IBX
by
laguna
[
Today
at 03:55:51 pm]
Which Linux version
by
Thaddy
[
Today
at 03:52:06 pm]
AsyncProcess not firing O...
by
dugga_doo
[
Today
at 03:51:11 pm]
TlsLib4Pascal
by
Xor-el
[
Today
at 03:06:13 pm]
Clean up and build
by
kapibara
[
Today
at 02:00:50 pm]
MR - DebuggerIntf for ter...
by
Martin_fr
[
Today
at 12:54:22 pm]
var vs out (including "co...
by
kupferstecher
[
Today
at 12:49:22 pm]
AArch64, load a constant ...
by
LemonParty
[
Today
at 12:31:06 pm]
Separators in the compone...
by
CM630
[
Today
at 10:29:56 am]
Lazarus undead repository...
by
Dankan1890
[
Today
at 10:28:54 am]
[RE-SOLVED] Splitting an ...
by
paweld
[
Today
at 09:52:15 am]
Why does Free Pascal use ...
by
MarkMLl
[
Today
at 09:30:40 am]
[Qt5/Qt6] JPSupport-Qt: J...
by
szlbz
[
Today
at 03:21:56 am]
Extended and XML Frames o...
by
matthius
[
Today
at 01:01:09 am]
Strangely - Not a questio...
by
Bart
[August 12, 2026, 10:26:58 pm]
Selected Text get number ...
by
Martin_fr
[August 12, 2026, 09:47:56 pm]
To DebugLn or not to Debu...
by
Martin_fr
[August 12, 2026, 09:01:02 pm]
Unleashed Pascal (async/a...
by
Martin_fr
[August 12, 2026, 08:54:07 pm]
New Big Integer library i...
by
ad1mt
[August 12, 2026, 07:16:56 pm]
The best name for procedu...
by
LemonParty
[August 12, 2026, 07:02:53 pm]
'ReadStr' ?
by
J-G
[August 12, 2026, 03:37:39 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: filtered dbgrid (Read 7010 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: 13646
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