CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 1999
    Posts
    2

    CRecordSet from 1 or N Tables

    I guess what I want to know if there are pro/cons to creating a CRecordSet Object that is built on many tables of the datasource? or should I make one object for each table??


  2. #2
    Join Date
    May 1999
    Location
    Wisconsin, USA
    Posts
    953

    Re: CRecordSet from 1 or N Tables

    Typically it is done by creating one CRecordset derived class per table.
    Otherwise an implied JOIN (SQL command) takes place.



  3. #3
    Join Date
    Apr 1999
    Location
    Alabama, USA
    Posts
    261

    Re: CRecordSet from 1 or N Tables

    Generally, I find it easiest to use create a CRecordset derived class for every table in the database. But If you are going to use a JOIN, you'll probably find it more convienent to use a dynamically bound recordset. There are samples of dynamic recordsets on this site somewhere.

    If you decide not to use a dynamically bound recordset, you can always derive from CRecordset and override GetDefaultSQL(). You also have to make sure that you declare and initialize all the correct members and RFX_ them appropriately in DoFieldExchange(). This is kind of a pain in the butt in my opinion, when dynamic recordsets are so much easier.

    One other thing to consider also is that different DBMSs use different syntax for joins, and this may cause a problem if your app must run against various data sources.

    Just My Two Cents...




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