🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #2058

records on DBGrid conditional to a second table

#2058
From: Y. Geoy
Date: Thu, 27 Nov 2003 15:32
30 lines
2006 bytes
Hi, I would like to display in a DBGrid only the records from an Access
table1 that depends on a Query of a second table2.
I can do the Query and see only the records I want in Table2, but after, how
can I do that?
I don't have any problem to do a Query and display data if it comes only
from Table1. By the way, the Post to Marcel "Borland C++ ADO
example/tutorial" was very useful.

Assume I have Table1:
field1(key)    field2    field3
1                    box    ...
2                    glass    ...
3                    cup    ...
4    ................

and Table2:
FieldA(key)    FieldB    FieldC
1                        2            Paul
2                        2            John
3                        2            Harry
4                        3            Harry
5                        3            John
6                        4            John
7                        5 ......

Here is the relation: table2.FieldB = table1.Field1
Let's say I would like to display all records in Table1 that belongs to
Harry; in this case records 2 and 3. For John, it would be 2,3 and 4.
Thank you!
Y Geoy
Technical Details
Message-ID: <3fc61938$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,bbd809c6005ff277,start
X-Google-Attributes: gid10698b,public
X-Google-ArrivalTime: 2003-11-27 07:40:59 PST
From: "Y. Geoy" <ygeoy@hotmail.com>
Newsgroups: borland.public.cppbuilder.database.ado
Subject: records on DBGrid conditional to a second table
Date: Thu, 27 Nov 2003 10:32:40 -0500
Lines: 34
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 65.95.33.220
Message-ID: <3fc61938$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1069947192 65.95.33.220 (27 Nov 2003 07:33:12 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail