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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How to DIY a filerec reco...
by
TYDQ
[
Today
at 05:59:45 am]
accessing array members i...
by
TRon
[
Today
at 05:56:59 am]
GTK3 still alpha
by
regs
[
Today
at 01:46:35 am]
2d "platform" game sugges...
by
flowCRANE
[
Today
at 12:25:28 am]
looping direction control...
by
440bx
[April 19, 2025, 08:08:37 pm]
ppaslink.sh: line 9: 6262...
by
Thaddy
[April 19, 2025, 07:58:29 pm]
JSON parser handler
by
cdbc
[April 19, 2025, 07:01:19 pm]
[SOLVED] Converting psd f...
by
TRon
[April 19, 2025, 06:58:36 pm]
This is me back in Lazaru...
by
TBMan
[April 19, 2025, 06:33:55 pm]
Avaiable instruction set
by
Thaddy
[April 19, 2025, 06:30:56 pm]
Best way to exchange data...
by
Hansvb
[April 19, 2025, 06:24:07 pm]
[Solved] How to call a cl...
by
nikel
[April 19, 2025, 05:09:22 pm]
Announcing TRURL RPN Engi...
by
jwdietrich
[April 19, 2025, 05:07:49 pm]
TRURL's segmitator availa...
by
jwdietrich
[April 19, 2025, 05:05:36 pm]
TRURL G released
by
jwdietrich
[April 19, 2025, 05:03:40 pm]
Animated Sine Flower
by
Thaddy
[April 19, 2025, 04:33:52 pm]
Compile Error on Assign f...
by
Thaddy
[April 19, 2025, 04:27:02 pm]
making types totally inco...
by
Thaddy
[April 19, 2025, 03:13:24 pm]
Why VirtualDBTreeEx not c...
by
wp
[April 19, 2025, 01:08:42 pm]
problem with easylazfreet...
by
ronhud
[April 19, 2025, 01:08:18 pm]
Forum slow for others as ...
by
Thaddy
[April 19, 2025, 11:25:43 am]
Errors linking the projec...
by
Thaddy
[April 19, 2025, 11:20:59 am]
in-memory machine code ge...
by
paule32
[April 19, 2025, 11:02:10 am]
Win11 - How to start cons...
by
dculp
[April 19, 2025, 12:21:51 am]
[SOLVED] Download link to...
by
Wings2018
[April 18, 2025, 10:37:08 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: DbGrid or TSQLQuery best option (Read 487 times)
eldonfsr
Hero Member
Posts: 543
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: 4281
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: 1592
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