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
A Project Inspector Page ...
by
EganSolo
[
Today
at 03:01:13 am]
[CLOSED] Hey! What about ...
by
EganSolo
[
Today
at 02:32:39 am]
Something kind of funny a...
by
OC DelGuy
[
Today
at 02:15:21 am]
Newbie in Web Programming...
by
Edgardo M. López
[
Today
at 01:34:43 am]
Why isn't Lazarus / Free ...
by
Lenny33
[
Today
at 01:10:14 am]
TListView - please advis...
by
TRon
[
Today
at 12:01:23 am]
Randomally generated code
by
rvk
[April 28, 2025, 11:06:58 pm]
Updating and redrawing SV...
by
PawelO
[April 28, 2025, 11:00:19 pm]
coded DBUG?
by
440bx
[April 28, 2025, 10:20:02 pm]
EOF Problem
by
OC DelGuy
[April 28, 2025, 09:38:57 pm]
hwnd type error
by
TBMan
[April 28, 2025, 09:10:31 pm]
'Events' Quiry
by
J-G
[April 28, 2025, 07:31:06 pm]
New shader examples for r...
by
Guva
[April 28, 2025, 07:18:51 pm]
Liverpool's wins are fib...
by
Thaddy
[April 28, 2025, 05:47:57 pm]
Why there is no build-in ...
by
Seenkao
[April 28, 2025, 05:41:52 pm]
Lazarus Install Question
by
440bx
[April 28, 2025, 04:28:40 pm]
Spiral search of an image
by
user5
[April 28, 2025, 04:05:34 pm]
[SOLVED] Testing with SQL...
by
1HuntnMan
[April 28, 2025, 03:53:35 pm]
Fpcupdeluxe
by
Philippe1
[April 28, 2025, 03:09:12 pm]
[Solved] Check if URL is ...
by
d2010
[April 28, 2025, 02:23:01 pm]
"Object Oriented Programm...
by
d.ioannidis
[April 28, 2025, 02:22:24 pm]
[solved with GENIUS demo]...
by
Nicole
[April 28, 2025, 01:53:07 pm]
Ctrl-V doesn't work anymo...
by
TRon
[April 28, 2025, 12:30:26 pm]
TStringGrid: what is the ...
by
Handoko
[April 28, 2025, 12:08:57 pm]
UUIDv7 library and demo
by
Thaddy
[April 28, 2025, 11:38:15 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: DbGrid or TSQLQuery best option (Read 489 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: 4329
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: 1594
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