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
Register global hotkey
by
regs
[
Today
at 03:16:26 pm]
Crystal report edit
by
Petrus Vorster
[
Today
at 03:12:59 pm]
TChart: Wrong default val...
by
CM630
[
Today
at 02:12:25 pm]
Faster asin() Was Hiding ...
by
MathMan
[
Today
at 01:58:30 pm]
ShortStrings vs long stri...
by
d2010
[
Today
at 01:51:58 pm]
Lazarus Bugfix Release 4....
by
Jonax
[
Today
at 12:29:11 pm]
[ANN] PasBuild 1.6.0 rele...
by
Graeme
[
Today
at 12:19:30 pm]
LazPaint (alpha-blending,...
by
circular
[
Today
at 11:25:15 am]
Qt6/Wayland clipboard: pa...
by
AlexTP
[
Today
at 10:32:32 am]
Debian removes FPC/Lazaru...
by
dbannon
[
Today
at 08:44:10 am]
Synchronizing Lazarus pro...
by
dbannon
[
Today
at 08:02:08 am]
[revisited] triple click
by
dbannon
[
Today
at 07:45:14 am]
class not found
by
paweld
[
Today
at 07:12:53 am]
Pipewire API
by
backprop
[
Today
at 05:44:44 am]
Any way to "embed" Window...
by
egsuh
[
Today
at 04:31:44 am]
Extended Module Player
by
Gigatron
[March 11, 2026, 11:33:54 pm]
A collection of daily *NI...
by
Roland57
[March 11, 2026, 06:40:37 pm]
88 year D. Knuth changes ...
by
Curt Carpenter
[March 11, 2026, 03:08:55 pm]
[ANN] PasBuild 1.5.0 rele...
by
Graeme
[March 11, 2026, 02:30:32 pm]
CADSys4 3D.
by
zamtmn
[March 11, 2026, 02:13:31 pm]
Need help with project ma...
by
dseligo
[March 11, 2026, 12:12:04 pm]
Questions about TFuncSeri...
by
hedgehog
[March 11, 2026, 09:50:46 am]
macOS 14+ Install Instruc...
by
CM630
[March 11, 2026, 07:56:45 am]
Update a table with an Au...
by
CraigC
[March 10, 2026, 10:54:23 pm]
TSplitter color property ...
by
backprop
[March 10, 2026, 08:43:28 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: DbGrid or TSQLQuery best option (Read 972 times)
eldonfsr
Hero Member
Posts: 560
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: 1756
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