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. Databases and C++

Databases and C++

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpdatabasequestion
7 Posts 4 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.
  • M Offline
    M Offline
    mcsherry
    wrote on last edited by
    #1

    Hi everyone, The problem I've got is that I need to open a database (*.mdb, the filename is choosen by the user) and then write rows (recordset?) of data to different tables within the database (the names of the tables will never change, but the tables will not contain any data at the start of the run apart from the field names). However there are some constraints: 1) I cant use anything to do with JET 2) I can include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!) not sure if I've made this clear enough.... but if anyone has any suggestions and can provide links to websites which contain non-mfc database code samples. many thanks Andy McSherry

    P M 2 Replies Last reply
    0
    • M mcsherry

      Hi everyone, The problem I've got is that I need to open a database (*.mdb, the filename is choosen by the user) and then write rows (recordset?) of data to different tables within the database (the names of the tables will never change, but the tables will not contain any data at the start of the run apart from the field names). However there are some constraints: 1) I cant use anything to do with JET 2) I can include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!) not sure if I've made this clear enough.... but if anyone has any suggestions and can provide links to websites which contain non-mfc database code samples. many thanks Andy McSherry

      P Offline
      P Offline
      pankajdaga
      wrote on last edited by
      #2

      Hi, Your post does not state clearly what the problem is. However, if you want to use non-mfc based database library, you can try using ADO. Try: http://www.developerfusion.com/show/4033/1/[^] Hope, it helps. Pankaj Without struggle, there is no progress

      M 1 Reply Last reply
      0
      • M mcsherry

        Hi everyone, The problem I've got is that I need to open a database (*.mdb, the filename is choosen by the user) and then write rows (recordset?) of data to different tables within the database (the names of the tables will never change, but the tables will not contain any data at the start of the run apart from the field names). However there are some constraints: 1) I cant use anything to do with JET 2) I can include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!) not sure if I've made this clear enough.... but if anyone has any suggestions and can provide links to websites which contain non-mfc database code samples. many thanks Andy McSherry

        M Offline
        M Offline
        mcsherry
        wrote on last edited by
        #3
        1. should read 2)I can't #include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!)
        R F 2 Replies Last reply
        0
        • P pankajdaga

          Hi, Your post does not state clearly what the problem is. However, if you want to use non-mfc based database library, you can try using ADO. Try: http://www.developerfusion.com/show/4033/1/[^] Hope, it helps. Pankaj Without struggle, there is no progress

          M Offline
          M Offline
          mcsherry
          wrote on last edited by
          #4

          cheers Pankaj it looks like the link you gave me has what I need to do! (I did look at ADO before but all the examples talked about JET, which meant I didnt delve too far into it) many thanks, Andy

          R 1 Reply Last reply
          0
          • M mcsherry

            cheers Pankaj it looks like the link you gave me has what I need to do! (I did look at ADO before but all the examples talked about JET, which meant I didnt delve too far into it) many thanks, Andy

            R Offline
            R Offline
            RChin
            wrote on last edited by
            #5

            mcsherry wrote: I did look at ADO before but all the examples talked about JET, which meant I didnt delve too far into it) The Microsoft Access Databases uses the JET engine, so you cannot avoid this. You will have to interact with the JET engine to communicate with the database no matter what method you use. Maybe your boss was taking about not using a specific technology (MFC's DAO classes, for example)?


            I Dream of Absolute Zero

            1 Reply Last reply
            0
            • M mcsherry
              1. should read 2)I can't #include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!)
              R Offline
              R Offline
              RChin
              wrote on last edited by
              #6

              Sorry, replied above before reading this ammendment. Those include files are MFC's database classes CDAOXXXX. ADO is definitely the way to go. You can find one or two very good ADO wrapper classes right here in CP to use in your project.


              I Dream of Absolute Zero

              1 Reply Last reply
              0
              • M mcsherry
                1. should read 2)I can't #include and as these cause compilation errors with the main library the software is built on. (the error is to do with GetTickCount, which is MFC even though its not used in the program and no methods exist in our code called GetTickCount!)
                F Offline
                F Offline
                forjer
                wrote on last edited by
                #7

                About GetTickCount errors, maybe it has to do with the macro GetCurrentTime which is defined as GetTickCount for backward compatibility. If that's the case, simply undefing the macro will do the job.

                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