Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Databases
»
DbGrid or TSQLQuery best option
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
Status of FPC 3.4.0 or FP...
by
marcov
[
Today
at 10:41:52 am]
Lazarus recompiles some o...
by
Hartmut
[
Today
at 09:26:21 am]
Strange Error in My Code ...
by
TYDQ
[
Today
at 09:18:58 am]
ThorVG - test (lightweigh...
by
hermet
[
Today
at 09:05:11 am]
External SIGSEV (Database...
by
Zvoni
[
Today
at 08:26:34 am]
[ANN] fpGUI Toolkit v2.0....
by
CM630
[
Today
at 08:02:35 am]
Debian removes FPC/Lazaru...
by
dbannon
[
Today
at 01:08:23 am]
[SOLVED] TaChart on MAC: ...
by
wp
[
Today
at 12:16:09 am]
Fast Canvas Library V1.05...
by
backprop
[February 10, 2026, 11:38:53 pm]
fpGUI vs MSEide + MSEgui?
by
Graeme
[February 10, 2026, 10:23:25 pm]
Is FPGUI still active?
by
Graeme
[February 10, 2026, 10:20:16 pm]
TRichMemo EM_FORMATRANGE ...
by
rvk
[February 10, 2026, 09:31:40 pm]
TLazSerial : serial port ...
by
CM630
[February 10, 2026, 09:14:56 pm]
it2play - IT/S3M module r...
by
Lulu
[February 10, 2026, 09:11:05 pm]
The Future of FPC
by
Ten_Mile_Hike
[February 10, 2026, 07:38:23 pm]
Fixing Lazarus 4.4 IDE la...
by
Curt Carpenter
[February 10, 2026, 06:47:29 pm]
Z80 ZX Spectrum and Syste...
by
Cascade
[February 10, 2026, 03:30:13 pm]
Where is Lazarus config
by
Martin_fr
[February 10, 2026, 12:10:36 pm]
Anchordocking - window pr...
by
Zvoni
[February 10, 2026, 10:41:04 am]
How to determine the unkn...
by
Hartmut
[February 10, 2026, 09:56:10 am]
Anchordocking - Window T...
by
janhsh
[February 10, 2026, 09:33:09 am]
Free Pascal for a small e...
by
dbannon
[February 10, 2026, 09:20:55 am]
Problem with Generic Cons...
by
SonnyBoyXXl
[February 10, 2026, 07:59:15 am]
[SHARE] Rotate and Flip b...
by
Xenno
[February 10, 2026, 07:37:56 am]
Pre-Specialize Generic Fu...
by
Khrys
[February 10, 2026, 07:02:30 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: DbGrid or TSQLQuery best option (Read 954 times)
eldonfsr
Hero Member
Posts: 557
DbGrid or TSQLQuery best option
«
on:
March 05, 2025, 03:42:43 pm »
Hi i have a problem do you know when we have dbgrid user can go down or up how can know when he move to next record or select record to update a tabcontrol where is locate dbgrid...filter record on another table...
afterscroll or beforescroll , datasource or ondatachange
Thanks
Logged
TRon
Hero Member
Posts: 4377
Re: DbGrid or TSQLQuery best option
«
Reply #1 on:
March 05, 2025, 04:02:46 pm »
Based on the description, though I have to guess a bit, you are probably referring to a master-detail solution.
See also
our wiki
where the concept is explained and an example provided.
Here
is another example (though it is quite old and I do not know if it still builds).
«
Last Edit: March 05, 2025, 04:08:50 pm by TRon
»
Logged
Today is tomorrow's yesterday.
egsuh
Hero Member
Posts: 1738
Re: DbGrid or TSQLQuery best option
«
Reply #2 on:
March 06, 2025, 05:10:34 am »
In addition to TRon's comment, you should focus on 'TDataSet descendants', e.g. TSQLQuery, not TDBGrid. What DBGrid does is to show the state of TDataSet. Filtering, etc. should be done on TDataSet descendants.
Logged
wcage03
New Member
Posts: 27
Re: DbGrid or TSQLQuery best option
«
Reply #3 on:
March 18, 2025, 07:32:28 pm »
The DBGrid will show you visually which row you are on in the dataset. The SQLQuery will actually be tracking to the specific row. You can do something like SQLQuery1.FieldByName('SomeField').AsString (or AsInteger, etc.) to grab the value of a field on the row that the DBGrid shows as selected. The DBGrid does a lot of additional things, but one thing it does is act sort of like a navigator within the dataset.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Databases
»
DbGrid or TSQLQuery best option
TinyPortal
© 2005-2018