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. CDatabase && CRecordSet

CDatabase && CRecordSet

Scheduled Pinned Locked Moved C / C++ / MFC
c++performancequestiondiscussion
10 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.
  • 0 Offline
    0 Offline
    0v3rloader
    wrote on last edited by
    #1

    Hello, In terms of performance, good programming, etc, is it better to derive [customized] classes from CDatabase and CRecordSet or is it preferable to build our own from scratch? What do you think about this? What I am trying to know is whether a Database Programmer finds all the functionalities he/she needs in these MFC classes or whether they'd be better off creating their own from scratch. All insights on the subject are very much appreciated. :) Thank you, David

    J M 2 Replies Last reply
    0
    • 0 0v3rloader

      Hello, In terms of performance, good programming, etc, is it better to derive [customized] classes from CDatabase and CRecordSet or is it preferable to build our own from scratch? What do you think about this? What I am trying to know is whether a Database Programmer finds all the functionalities he/she needs in these MFC classes or whether they'd be better off creating their own from scratch. All insights on the subject are very much appreciated. :) Thank you, David

      J Offline
      J Offline
      Jaime Stuardo
      wrote on last edited by
      #2

      AFAIK CDatabase, CRectordset, etc, connects to a database by using ODBC driver, and that way of connection is always slower than accessing directly database native driver, as it adds other layer to the database connection. They are easy to use, bad provide poor performance. To connect to database I programmed my own class named CDatabase that encapsulates all database connection using ADO. It's known that by using ADO, the program doesn't access directly the database driver, but it's only one layer over the OLEDB driver, being a good choice (and easy choice) to access a database. Jaime

      0 1 Reply Last reply
      0
      • J Jaime Stuardo

        AFAIK CDatabase, CRectordset, etc, connects to a database by using ODBC driver, and that way of connection is always slower than accessing directly database native driver, as it adds other layer to the database connection. They are easy to use, bad provide poor performance. To connect to database I programmed my own class named CDatabase that encapsulates all database connection using ADO. It's known that by using ADO, the program doesn't access directly the database driver, but it's only one layer over the OLEDB driver, being a good choice (and easy choice) to access a database. Jaime

        0 Offline
        0 Offline
        0v3rloader
        wrote on last edited by
        #3

        But what kind of database(s) do you usually use? MsAccess and the likes, or Oracle/... ? I am asking this because I heard something before about the ADO technology only allowing you to connect to the Microsoft Jet-type databases. Is this right? dNimrod#X ________________________

        J 1 Reply Last reply
        0
        • 0 0v3rloader

          But what kind of database(s) do you usually use? MsAccess and the likes, or Oracle/... ? I am asking this because I heard something before about the ADO technology only allowing you to connect to the Microsoft Jet-type databases. Is this right? dNimrod#X ________________________

          J Offline
          J Offline
          Jaime Stuardo
          wrote on last edited by
          #4

          it's wrong. ADO can connect to any database that has supporting driver installed in the system. I have used it in Access (Microsoft Jet), SQL Server (SQLOLEDB) and Oracle (MSDAORA) Jaime

          0 1 Reply Last reply
          0
          • J Jaime Stuardo

            it's wrong. ADO can connect to any database that has supporting driver installed in the system. I have used it in Access (Microsoft Jet), SQL Server (SQLOLEDB) and Oracle (MSDAORA) Jaime

            0 Offline
            0 Offline
            0v3rloader
            wrote on last edited by
            #5

            I see! I hope you'll bear with me, I am a newbee in database programming... :wtf: Let me ask you though, is there any MFC class supporting ADODB connections?, I've been searching but found none... For what I could see, ADODB connections are a form of interacting with databases through OLE ?

            J 1 Reply Last reply
            0
            • 0 0v3rloader

              I see! I hope you'll bear with me, I am a newbee in database programming... :wtf: Let me ask you though, is there any MFC class supporting ADODB connections?, I've been searching but found none... For what I could see, ADODB connections are a form of interacting with databases through OLE ?

              J Offline
              J Offline
              Jaime Stuardo
              wrote on last edited by
              #6

              MFC doesn't provide a class for connecting to database using ADODB, that's why I programmed my own CDatabase class that #imports the ADO DLL to use the wrapper classes, and call the more common methods, for example, Execute to execute a query. In order to fully understand, you need knowledge on COM technology. I think here in codeproject you may be able to find info on this topic (in www.google.cl you can find a lot of stuff, for sure) Jaime

              0 1 Reply Last reply
              0
              • J Jaime Stuardo

                MFC doesn't provide a class for connecting to database using ADODB, that's why I programmed my own CDatabase class that #imports the ADO DLL to use the wrapper classes, and call the more common methods, for example, Execute to execute a query. In order to fully understand, you need knowledge on COM technology. I think here in codeproject you may be able to find info on this topic (in www.google.cl you can find a lot of stuff, for sure) Jaime

                0 Offline
                0 Offline
                0v3rloader
                wrote on last edited by
                #7

                Thanks a lot for all the input, Eduardo! Cheers, David

                J 1 Reply Last reply
                0
                • 0 0v3rloader

                  Thanks a lot for all the input, Eduardo! Cheers, David

                  J Offline
                  J Offline
                  Jaime Stuardo
                  wrote on last edited by
                  #8

                  you are welcome... but my name isn't Eduardo, it is Jaime, and my surname Stuardo :)

                  0 1 Reply Last reply
                  0
                  • J Jaime Stuardo

                    you are welcome... but my name isn't Eduardo, it is Jaime, and my surname Stuardo :)

                    0 Offline
                    0 Offline
                    0v3rloader
                    wrote on last edited by
                    #9

                    I am sorry for having mixed up your name, Jaime! Again, thanks for the help! :) David

                    1 Reply Last reply
                    0
                    • 0 0v3rloader

                      Hello, In terms of performance, good programming, etc, is it better to derive [customized] classes from CDatabase and CRecordSet or is it preferable to build our own from scratch? What do you think about this? What I am trying to know is whether a Database Programmer finds all the functionalities he/she needs in these MFC classes or whether they'd be better off creating their own from scratch. All insights on the subject are very much appreciated. :) Thank you, David

                      M Offline
                      M Offline
                      Michael P Butler
                      wrote on last edited by
                      #10

                      I haven't used the MFC database classes for quiet a few years. I much prefer to use ADO. There are some nice wrapper classes here[^] Michael CP Blog [^]

                      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