CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    Using Multiple Database Tables

    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
    [email protected]


  2. #2
    Guest

    Re: Using Multiple Database Tables

    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



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured