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. ADOX and adding two databases

ADOX and adding two databases

Scheduled Pinned Locked Moved C / C++ / MFC
databasetutorial
6 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.
  • N Offline
    N Offline
    ns
    wrote on last edited by
    #1

    I think it will need ADOX, but are there any links/samples that show how to merge database1 and database2 to create a final database. The number of fields in each db is different, and some of them are distinct, though some overlap. Thanks, ns

    M 1 Reply Last reply
    0
    • N ns

      I think it will need ADOX, but are there any links/samples that show how to merge database1 and database2 to create a final database. The number of fields in each db is different, and some of them are distinct, though some overlap. Thanks, ns

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

      Do you mean merging seperate databases or seperate tables? Can you provide more information about your database format etc. Michael Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.

      N 1 Reply Last reply
      0
      • M Michael P Butler

        Do you mean merging seperate databases or seperate tables? Can you provide more information about your database format etc. Michael Programming is great. First they pay you to introduce bugs into software. Then they pay you to remove them again.

        N Offline
        N Offline
        ns
        wrote on last edited by
        #3

        EAch access database has one table. SOme of the fields overlap. I need to merge these two different databases, so that the new one has all the fields (union of), and whatever field was not present in database 1, should have entries "abc", likewise if the field wasnt present in database2, those records should have entries "abc" too. I suppose one could at first check and see which fields are different, then use ADOX for each database to add the new fields and populate them. So now we have two dbs with identical fields (different number of records of course). Now how to merge these two databases so the final one has one table in it which is the sum of the tables from db1 and db2. Hope this is clearer... Thanks, ns

        B 1 Reply Last reply
        0
        • N ns

          EAch access database has one table. SOme of the fields overlap. I need to merge these two different databases, so that the new one has all the fields (union of), and whatever field was not present in database 1, should have entries "abc", likewise if the field wasnt present in database2, those records should have entries "abc" too. I suppose one could at first check and see which fields are different, then use ADOX for each database to add the new fields and populate them. So now we have two dbs with identical fields (different number of records of course). Now how to merge these two databases so the final one has one table in it which is the sum of the tables from db1 and db2. Hope this is clearer... Thanks, ns

          B Offline
          B Offline
          Bill Wilson
          wrote on last edited by
          #4

          Do you just need the result or do you actually need a program that does this. If itst the result you're looking for. Do it in Access by importing data from one DB into the other ( or import both into a new DB). Create a table with all the fields you want. Use Insert queries to move the data from the old tables to the new one. Even if you need to be able to repeat the process. I'd recommend doing this in Access. Just write a VBA script to do the job.

          N 1 Reply Last reply
          0
          • B Bill Wilson

            Do you just need the result or do you actually need a program that does this. If itst the result you're looking for. Do it in Access by importing data from one DB into the other ( or import both into a new DB). Create a table with all the fields you want. Use Insert queries to move the data from the old tables to the new one. Even if you need to be able to repeat the process. I'd recommend doing this in Access. Just write a VBA script to do the job.

            N Offline
            N Offline
            ns
            wrote on last edited by
            #5

            Unfortunately I have to do this with code as a feature of another program. I'm using MFC...

            B 1 Reply Last reply
            0
            • N ns

              Unfortunately I have to do this with code as a feature of another program. I'm using MFC...

              B Offline
              B Offline
              Bill Wilson
              wrote on last edited by
              #6

              Its too bad you have to do this in VC++. That will be the most ineffective language to use. Your original post posed this question: are there any links/samples that show how to merge database1 and database2 to create a final database I can't imagine that there are. That's a pretty odd thing to do to databases. Using MFC or anything else, the process will be as I described earlier. I have seen code samples of creating a new database and tables from VC, but I can't remember exactly where. With a little effort you should be able to find examples of each of the steps. Good luck, Bill

              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