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
Lazarus 4.0 and INT3 gets...
by
440bx
[
Today
at 06:00:11 am]
Serial port
by
Lauriet
[
Today
at 04:23:55 am]
Break program and debug
by
What I can do
[
Today
at 04:16:00 am]
Feature request/suggestio...
by
440bx
[
Today
at 02:27:30 am]
Automatically compiling d...
by
440bx
[
Today
at 02:24:03 am]
[SOLVED] How to define a ...
by
440bx
[
Today
at 02:14:21 am]
How to close a window whi...
by
n7800
[
Today
at 01:49:44 am]
Feature announcement: Fun...
by
munair
[
Today
at 01:26:22 am]
Feature Request/Suggestio...
by
440bx
[
Today
at 01:06:03 am]
A little bug in fpsimages...
by
Roni Wolf
[May 21, 2025, 11:51:57 pm]
64 bits and PascalScript
by
jamie
[May 21, 2025, 11:27:42 pm]
LAMW arduino serial comm ...
by
jmpessoa
[May 21, 2025, 11:21:46 pm]
Lazarus Release 4.0
by
dsiders
[May 21, 2025, 10:43:31 pm]
Anything more complicated...
by
440bx
[May 21, 2025, 10:21:48 pm]
How can I make an externa...
by
Sander
[May 21, 2025, 09:51:14 pm]
Database Locked Exception
by
cdbc
[May 21, 2025, 08:24:46 pm]
Learn how to (un)dock a T...
by
Hansvb
[May 21, 2025, 08:16:05 pm]
Certifying windows execut...
by
ASBzone
[May 21, 2025, 08:08:19 pm]
fpc 3.2.2 + win32api Call...
by
paule32
[May 21, 2025, 08:01:05 pm]
[SOLVED]Help: Need Advice...
by
TBMan
[May 21, 2025, 07:26:38 pm]
IDE crashes and takes so ...
by
Martin_fr
[May 21, 2025, 06:26:16 pm]
full featured Android Nat...
by
Handoko
[May 21, 2025, 06:21:06 pm]
Error trying to initializ...
by
silvercoder70
[May 21, 2025, 02:30:07 pm]
Unable to access the wiki
by
Aruna
[May 21, 2025, 01:36:51 pm]
Unexpected highlighted li...
by
Thaddy
[May 21, 2025, 11:30:15 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: DbGrid or TSQLQuery best option (Read 509 times)
eldonfsr
Hero Member
Posts: 548
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: 4371
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: 1600
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