C++ encapsulation class for ADO
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8

Thread: C++ encapsulation class for ADO

  1. #1
    Join Date
    Nov 2010
    Posts
    47

    C++ encapsulation class for ADO

    Hi,

    I am looking for a good C++ encapsulation class for ADO. Just like CDatabase/CRecordset for ODBC and CDAODatabase/CDAORecordset for DAO. It is better to have a CADODatabase/CADORecordset for ADO to simplify the using of ADO in C++/MFC project.

    I find one at Codeproject http://www.codeproject.com/Articles/...s-version-2-20 . However, that works only for Visual Studio 6.0, so is outdated. Are there any similar encapsulation class works for Visual Studio 2008/2010?

    I can accept either free source codes or paid third-party classes or libraries, if any.

    Thanks

  2. #2
    VictorN's Avatar
    VictorN is online now Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,301

    Re: C++ encapsulation class for ADO

    Which parts of this class do NOTwork for Visual Studio 2008/2010?
    Victor Nijegorodov

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: C++ encapsulation class for ADO

    Check out the ATL OLEDB Consumer classes. To use, right click on the project in the solution explorer, choose "Add Class", choose "ATL" and select the ATL OLEDB Consumer class.

    This class (like ADO) requires COM support, you can easily add this by choosing the Add ATL Support to MFC new class option.

  4. #4
    Join Date
    Nov 2010
    Posts
    47

    Re: C++ encapsulation class for ADO

    First of all, the CodeProject classes are not compatible with Unicode. After making necessary modifications, I rebuild it but get more compiler errors under VS2008(such as ambiguous calls to overloaded function, etc.). So I believe it is not compatible with VS2008. While the same code base can be built under VS6.

    Thanks

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: C++ encapsulation class for ADO

    Quote Originally Posted by AlanCCC View Post
    First of all, the CodeProject classes are not compatible with Unicode. After making necessary modifications, I rebuild it but get more compiler errors under VS2008(such as ambiguous calls to overloaded function, etc.). So I believe it is not compatible with VS2008. While the same code base can be built under VS6.

    Thanks
    That's only because VS2008 projects default to UNICODE; whereas VC6 projects do not. Change the compiler to build for UNICODE in VC6 and you'll see the same errors if the classes didn't use the _T() or TEXT() macros internally.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: C++ encapsulation class for ADO

    Alan, at any rate, the sample code you have relies on older ADO libraries. Plus the sample is 8 years old.

    Why not try the ATL OLEDB Consumer approach I posted earlier?

  7. #7
    Join Date
    Nov 2010
    Posts
    47

    Re: C++ encapsulation class for ADO

    The ATL OLEDB cusumer class seems must to be bound with a given data source. While my application will open and access the data source dymanically.

  8. #8
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,202

    Re: C++ encapsulation class for ADO

    Quote Originally Posted by AlanCCC View Post
    The ATL OLEDB cusumer class seems must to be bound with a given data source. While my application will open and access the data source dymanically.
    Um, kind of. It will be bound to the same database schema, but not to same data source. You can open a connection to different data sources by changing the connection string.

Posting Permissions

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


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center