Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


DAO - Database Access compatibility with Oracle, Sybase, and SQL Server through ODBC

Posted on 2005-03-15
Medium Priority
Last Modified: 2010-04-01
I'm updating an older program, and need to add ODBC Support for Oracle, Sybase and SQL Server. The code is using DAO for database access, and I would like to keep that infrastructure.

What is the preferred way of connecting/querying/updating records in C++ using DAO?

Question by:debtoine
LVL 86

Accepted Solution

jkr earned 500 total points
ID: 13545104
I'd suggest to start out with http://msdn.microsoft.com/library/en-us/vctutor98/html/_gs_data_access_objects_.28.dao.29_.tutorial.asp ("Data Access Objects (DAO) Tutorial"). From my experience (yet that is a few years ago :o), if you have wored with ODBC and it's MFC encapsulation before, you'll soon be familiar with DAO.

Expert Comment

ID: 13545469
Just a thought -- I'd be a little bit careful about using MFC's DAO classes. We use it extensively in our VC 6.0 vintage project work (DAO is still the fastest database access method Microsoft supports). However, in porting to VS .Net 2003 (VC7), MFC's DAO classes keep popping up deprecated warnings that worry me about the future of DAO in the MFC framework. I know that Microsoft has been pushing people to move from DAO to ADO or OLEDB for years now but haven't succeeded in killing off the DAO API. Because of this we are evaluating whether to move our MFC DAO classes over to OLEDB in VC7.
LVL 39

Assisted Solution

itsmeandnobodyelse earned 500 total points
ID: 13563736
Did you already manage the connections to Oracle and Sybase?

DAO's primary goal was to get a better performance than with ODBC for ACCESS and SQLServer DBMS using the jet engine. AFAIK, you could connect to ORACLE only by using the Microsoft ODBC driver for ORACLE and *not* the ODBC driver that came with ORACLE DBMS (my favorite). For SYBASE I don't know, however as SQLServer formerly was a SYBASE DBMS it could work with no problems.

Because of these restrictions I used the CDatabase/CRecordset ODBC interface of MFC in some projects and made my own class library based on native ODBC. However, DAO has some nice query functions that couldn't easily substituted by another interface.

Regards, Alex

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question