Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to use MFC to design an app that can connect 2 types of database

How to use MFC to design an app that can connect 2 types of database

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasesql-serverdesigntutorial
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DHLao
    wrote on last edited by
    #1

    I never use VC++ to develop an app that use to connect and update database before. My app is design to allow user to update the database by supply MS Excel file. When the app open, user need to choose either connect to MS Access 2010 (.mdb) or MSSQL 2014 express. By using MFC Application Wizard, I need to choose which client type to use at Database support section (ODBC or OLEDB). After reference to the doc on the web. Seems that OLEDB suitable for Access and ODBC suitable for MSSQL. This make me has a difficulty to choose between them during start. Or I should create a project that has no database support at start, then add DLL that support database to this solution later. But the wizard that use to create MFC DLL and ATL Project has no section for choose database support. Any advice and suggestion that direct me how to start is appreciated.

    J J 2 Replies Last reply
    0
    • D DHLao

      I never use VC++ to develop an app that use to connect and update database before. My app is design to allow user to update the database by supply MS Excel file. When the app open, user need to choose either connect to MS Access 2010 (.mdb) or MSSQL 2014 express. By using MFC Application Wizard, I need to choose which client type to use at Database support section (ODBC or OLEDB). After reference to the doc on the web. Seems that OLEDB suitable for Access and ODBC suitable for MSSQL. This make me has a difficulty to choose between them during start. Or I should create a project that has no database support at start, then add DLL that support database to this solution later. But the wizard that use to create MFC DLL and ATL Project has no section for choose database support. Any advice and suggestion that direct me how to start is appreciated.

      J Offline
      J Offline
      Jochen Arndt
      wrote on last edited by
      #2

      There are no limitations to support different types of databases in one application. The application wizard only prepares the project to support a specific database interface. Support for other interfaces can be added later manually. My suggestion: Create two new empty projects with support for different database interfaces. Then choose one as your project and add the necessary definitions from the created source files of the other project by comparing the files.

      D 1 Reply Last reply
      0
      • J Jochen Arndt

        There are no limitations to support different types of databases in one application. The application wizard only prepares the project to support a specific database interface. Support for other interfaces can be added later manually. My suggestion: Create two new empty projects with support for different database interfaces. Then choose one as your project and add the necessary definitions from the created source files of the other project by comparing the files.

        D Offline
        D Offline
        DHLao
        wrote on last edited by
        #3

        Thanks for reply. Since wizard can relief my work. I just think is it possible to select both ODBC and OLEDB by using wizard. If it is not possible, I have to implement the code myself. That's hell a lot of work X|

        J 1 Reply Last reply
        0
        • D DHLao

          Thanks for reply. Since wizard can relief my work. I just think is it possible to select both ODBC and OLEDB by using wizard. If it is not possible, I have to implement the code myself. That's hell a lot of work X|

          J Offline
          J Offline
          Jochen Arndt
          wrote on last edited by
          #4

          The selection uses radio buttons. So only one can be selected. You must write the code to access the database anyway. The wizard will not do that. It just prepares your project. Merging two empty projects into one is not much work.

          1 Reply Last reply
          0
          • D DHLao

            I never use VC++ to develop an app that use to connect and update database before. My app is design to allow user to update the database by supply MS Excel file. When the app open, user need to choose either connect to MS Access 2010 (.mdb) or MSSQL 2014 express. By using MFC Application Wizard, I need to choose which client type to use at Database support section (ODBC or OLEDB). After reference to the doc on the web. Seems that OLEDB suitable for Access and ODBC suitable for MSSQL. This make me has a difficulty to choose between them during start. Or I should create a project that has no database support at start, then add DLL that support database to this solution later. But the wizard that use to create MFC DLL and ATL Project has no section for choose database support. Any advice and suggestion that direct me how to start is appreciated.

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            Note that reading even a trivial excel file in an application can be a difficult task. Once you have read the data the user interface and writing to a database is easier because there are more sources that one can learn from.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups