RAYMOND HJ
10-19-2000, 08:47 AM
Hallo HI...
I have a problem to display record in a relational database.
I'm using Microsoft Acess database ( 2 tables )
Table 1: BOOK ( contains 3 fields )
Title_Id (AutoNumber - Primary Key)
Title (Text)
Author_Id (Number - Key Field - related : one to many)
Table 2: AUTHORS ( contains 2 fields )
Author_Id (AutoNumber - Primary Key)
Name (Text)
Here is the code:
Dim db As Database
Dim RS1 As Recordset, RS2 As Recordset
Set db = Workspaces0).OpenDatabase "C:BOOKS.MDB")
Set RS1 = db.OpenRecordset("BOOK", dbOpenTable)
Set RS2 = db.OpenRecordset("AUTHORS", dbOpenTable)
do while NOT RS2.Eof
msflex1.col = 0
msflex1.text = RS2!TITLE
msflex1.col = 1
msflex1.text = RS1!NAME ' problem rise here
RS2.movenext
loop
The problem : I cannot display author Name from AUTHORS TABLE related to the BOOK record. I can see only the name from the first record only (AUTHORS TABLE)
Thank you for your help...
I have a problem to display record in a relational database.
I'm using Microsoft Acess database ( 2 tables )
Table 1: BOOK ( contains 3 fields )
Title_Id (AutoNumber - Primary Key)
Title (Text)
Author_Id (Number - Key Field - related : one to many)
Table 2: AUTHORS ( contains 2 fields )
Author_Id (AutoNumber - Primary Key)
Name (Text)
Here is the code:
Dim db As Database
Dim RS1 As Recordset, RS2 As Recordset
Set db = Workspaces0).OpenDatabase "C:BOOKS.MDB")
Set RS1 = db.OpenRecordset("BOOK", dbOpenTable)
Set RS2 = db.OpenRecordset("AUTHORS", dbOpenTable)
do while NOT RS2.Eof
msflex1.col = 0
msflex1.text = RS2!TITLE
msflex1.col = 1
msflex1.text = RS1!NAME ' problem rise here
RS2.movenext
loop
The problem : I cannot display author Name from AUTHORS TABLE related to the BOOK record. I can see only the name from the first record only (AUTHORS TABLE)
Thank you for your help...