Click to See Complete Forum and Search --> : Using Multiple Database Tables


April 10th, 1999, 12:46 AM
Ok, there is most likey a simple answer to this question but I am a little confused.
I want to use 4 tables for the same database, but when I use the appwizard and
select all the tables from the database, some of my records have multiple rows even though they are only
in one table. Am I overlooking some simple concept they talked about in the help? There is
one main table and then the 3 other tables relate to the main table in case you need to know
that to make any suggestions. Any help would be greatly appreciated.

Thanks
Scott
semacdi@hotmail.com

April 10th, 1999, 09:27 AM
Hi,

one way to go about this is to have a CRecordset or CDaoRecordset assigned to each table, eg CTable1 m_setTable1, CTable2 m_setTable2 etc where CTable1 has been dervied fron either a CRecordset or CDaoRecordset. Subsequently, you can then open the required datatable and perform the relevant functions etc. The downside of this method is that it is table specific as far as code is concerned but it is very easy to implement.

You obviously need to assign the correct field types and so on to each of the files generated (such as Table1.cpp) to handle the data transfers and updates correctly. There are several good examples in the Database section of this site to review for these types of tasks.

Hope this helps,

regards,

Daniel