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