Existing MFC app. Switching from ODBC to OLE DB. ATL or MFC? Can I mix?

I have an existing MFC app in which I connect to a VFP database using ODBC.

Since VFP no longer supports ODBC, I am switching to OLE DB for the connection.

Should I be using MFC or ATL to implement this interface

Can I mix ATL classes in my MFC application

The MSDN library has the following comments that I don't understand:

The following example assumes that you are adding OLE DB consumer support to an existing ATL project. If you want to add OLE DB consumer support to an MFC application, you should run the MFC Application Wizard, which creates all the support necessary and invokes MFC routines necessary to execute the application.

When I originally created this APP I did run the MFC Application Wizard at that time. But, I don't remember all of the choices that I made.

Thanks for your help.

Jim



Answer this question

Existing MFC app. Switching from ODBC to OLE DB. ATL or MFC? Can I mix?

  • Sébastien Nunes

    Ayman,

    Thanks for following up with my problem.

    I will log this as you've indicated.

    I have some additional information about the problem that I will post in the other thread, the one actually about the crash. I don't want to mix these threads because I would like to get some answers to the question that I posted in this thread.

    Jim


  • pdianne

    Sounds good Jim! Once more, sorry about the confusion I might have caused by deleting your previous thread. I totally take the blame here.

    Thanks,
    Ayman Shoukry
    VC++ Team


  • holthaus

    Hi Jim,

    DrJim wrote:

    Should I be using MFC or ATL to implement this interface

    MFC provides only COleDBRecordView class, which is basically a view of record set. Rest of functional classes for OLE DB are parts of ATL, so-called OLE DB templates. This section in docs has links to relevant sections, http://msdn2.microsoft.com/en-us/library/502e07a7.aspx

    DrJim wrote:

    Can I mix ATL classes in my MFC application

    yes, you can.

    DrJim wrote:

    The MSDN library has the following comments that I don't understand:

    The following example assumes that you are adding OLE DB consumer support to an existing ATL project. If you want to add OLE DB consumer support to an MFC application, you should run the MFC Application Wizard, which creates all the support necessary and invokes MFC routines necessary to execute the application.

    When I originally created this APP I did run the MFC Application Wizard at that time. But, I don't remember all of the choices that I made.

    That sample demonstrates what code has to be added into existing ATL solution. There is not need for such a sample for MFC based project. Because one can easily generate such a sample using new New MFC application wizard in Visual Studio. In that wizard, there is a tab "Database support" that let you choose to add Ole DB support to a new MFC project. After this new project is generated by the wizard, you may use the generated code as an example of how to add OLE DB support into an existing MFC application. This wizard can only be run to create new projects. You cannot use it to change settings of an existing project.

    Thanks,

    Nikola



  • kennm

    I don't believe the wizard should crash. Could you please log the issue at http://connect.microsoft.com/Main/content/content.aspx ContentID=2220 so that owners could take a look. Make sure to include all the steps needed to reproduce the crash.

    Thanks a lot in advance for taking the time to log ths issue!

    Thanks,
    Ayman Shoukry
    VC++ Team


  • DigitalFusion

    Ayman,

    Thanks for your response to my posting. I am sorry about the earlier confusion.

    I hope that these two postings get to the heart of what I am trying to do. The MSDN documentation is not especially clear. The fact that the VS2005 wizard crashes really leaves me in limbo.

    I hope I can get some answers here.

    Jim


  • Simon McMahon

    Hello Jim,

    I just wanted to let you know that your previous post is at http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=794732&SiteID=1. I believe I deleted it once by mistake. I am sorry for that.

    Hope you get answers to your issues! Let me know if I can be of any help.

    Thanks,
    Ayman Shoukry
    VC++ Team


  • Existing MFC app. Switching from ODBC to OLE DB. ATL or MFC? Can I mix?