-
May 1st, 2013, 01:23 PM
#1
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
-
May 1st, 2013, 03:11 PM
#2
Re: C++ encapsulation class for ADO
Which parts of this class do NOTwork for Visual Studio 2008/2010?
Victor Nijegorodov
-
May 1st, 2013, 03:29 PM
#3
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.
-
May 1st, 2013, 05:18 PM
#4
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
-
May 1st, 2013, 05:56 PM
#5
Re: C++ encapsulation class for ADO
Originally Posted by AlanCCC
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.
-
May 1st, 2013, 06:11 PM
#6
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?
-
May 2nd, 2013, 01:20 PM
#7
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.
-
May 2nd, 2013, 01:46 PM
#8
Re: C++ encapsulation class for ADO
Originally Posted by AlanCCC
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|