Shella
September 19th, 1999, 06:32 AM
Hi,
I've fully completed my project but the only flaw is I dunno how
to retrieve a list of
1 to Many relationship's records in DBGRID.
For a simple example as listed below
----------------------------------
ID Name Age Course |
----------------------------------
01 John 19 MS ACCESS
01 John 19 MS WINDOWS
01 John 19 MS POWER POINT
02 Joe 20 MS ACCESS
02 Joe 20 MS PUBLISHER
03 WAYE 21 VB
03 WAYE 21 PASCAL
ID, Name, Age is in Student Table, Course is in
Course Table, the relationship of these two tables
is 1 to Many in which a student can enrol in many courses
as possible. As I use Data Control and the following method
DataControl.RecordSource = SQL
DataControl.Refresh
(DBGrid is bound to DataControl).
I get the result as shown above, there're
7 records being called by DataControl and listed in DBGRID.
My point is, how can I get the outcome as shown below, where the fields
in Student Table just occur once no matter how many courses the
student enrol in, and the DataControl will show there're only 3 (based
on the number of ID occurence) records but NOT 7 (based on the number
of Course occurence) anymore.
----------------------------------
ID Name Age Course |
----------------------------------
01 John 19 MS ACCESS
MS WINDOWS
MS POWER POINT
02 Joe 20 MS ACCESS
MS PUBLISHER
03 WAYE 21 VB
PASCAL
----------------------------------------
Is my idea possible in VB ? Please and Thank you very much, eagerly
waiting for solution.
I've fully completed my project but the only flaw is I dunno how
to retrieve a list of
1 to Many relationship's records in DBGRID.
For a simple example as listed below
----------------------------------
ID Name Age Course |
----------------------------------
01 John 19 MS ACCESS
01 John 19 MS WINDOWS
01 John 19 MS POWER POINT
02 Joe 20 MS ACCESS
02 Joe 20 MS PUBLISHER
03 WAYE 21 VB
03 WAYE 21 PASCAL
ID, Name, Age is in Student Table, Course is in
Course Table, the relationship of these two tables
is 1 to Many in which a student can enrol in many courses
as possible. As I use Data Control and the following method
DataControl.RecordSource = SQL
DataControl.Refresh
(DBGrid is bound to DataControl).
I get the result as shown above, there're
7 records being called by DataControl and listed in DBGRID.
My point is, how can I get the outcome as shown below, where the fields
in Student Table just occur once no matter how many courses the
student enrol in, and the DataControl will show there're only 3 (based
on the number of ID occurence) records but NOT 7 (based on the number
of Course occurence) anymore.
----------------------------------
ID Name Age Course |
----------------------------------
01 John 19 MS ACCESS
MS WINDOWS
MS POWER POINT
02 Joe 20 MS ACCESS
MS PUBLISHER
03 WAYE 21 VB
PASCAL
----------------------------------------
Is my idea possible in VB ? Please and Thank you very much, eagerly
waiting for solution.