VC++  & CDaoDatabase classes

Posted on 1999-06-28
Medium Priority
Last Modified: 2013-11-20
I am trying to connect to Oracle database through
VC++,though there are special ODBC classes provided
by MFC,because of certain needs,I have to use
CDaoDatabase classes.But it is not getting connected
through ODBC.I think I am wrong somewhere because i
have never used ODBC.As there is Open method provided by
CDaoDatabase.If anybody can tell me how to connect to
Oracle database,to access all the tabledefs,and relationships
I will be thankful to you.It will be just small code.
And I think we can use ODBC API's also.But I don't know
how.VB programmers are used to connect to Oracle database.
But instead of connecting directly through ODBC,if you
know how to connect through JET engine.
Eagerly waiting for your reply.

Question by:kulabhi
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

BlackRussian earned 200 total points
ID: 1308155
I believe you have to use ODBC for Oracle. But below I show a code snippet opening a FoxPro database directly using DAO classes. Also in your online documentation search for accessing extrenal databases.

CDaoDatabase      *db_object;

// create and open  database object

 db_object= new CDaoDatabase (NULL);

if (db_object NOTEQUAL NULL)
      db_object->Open ("",FALSE,FALSE,_T("FoxPro                           2.5;DATABASE=D:\\DB"));
       CATCH (CDaoException,db_err)
       err_string.LoadString (IDS_OPEN_DBERR);
                  err_string +=          db_err->m_pErrorInfo->m_strDescription;
      AfxMessageBox (err_string,NULL,MB_OK);
       return FALSE;

you can then create a recorset object and open a specific table.

Featured Post

Technology Partners: 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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

719 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