ADO using MFC

Posted on 2006-04-28
Last Modified: 2013-11-20
Dear Experts,
 Would you please provide me with an example or link of how can I use ADO with MFC?
Thank you
Question by:hvelasco
    LVL 49

    Accepted Solution

    Please check out this post:

    It shows how to get started with ADO in a C++ program.  It assumes that you have a database already layed out that you can access from SQL Query Analyzer or other interactive database tool.

    That example uses a console-style wrapper (i.e., a main() fn and all that) -- the idea being that using that format makes it clear that that is *all* of the steps (nothing gets done behind the sceness by the ClassWizard, etc.)

    For instance, you can use the same sequence in a button handler in an MFC dialog-based application.

    Incidently, I prefer to use the ODBC-based MFC objects CDatabase and CRecordset (over the basically manual-coding of ADO access) becasue they are so simple and flexible and the CLassWizard provides a very easy way to create internal memroy structures that exactly echo the data in the database.

    -- Dan
    LVL 22

    Assisted Solution


    Sample: ADOVC1 Simple ADO/VC++ Application <===

    and 'ActiveX Data Objects (ADO) Frequently Asked Questions' <=== <==

    LVL 43

    Assisted Solution

    Here is a good set of wrapper classes for ADO

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
    Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
    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.
    how to add IIS SMTP to handle application/Scanner relays into office 365.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now