|
-
Aug 22nd, 2002, 10:07 AM
#1
Thread Starter
Fanatic Member
Database developer's challenge - how to combine data from several databases?
Consider this problem.
I have two tables (say in an Access 2000 database) - Bank and Account
Bank has following fields
No (auto number)
BankName
User
Account has following fields
BankNo (foreign key Bank.No)
AccountNo
User
Now, say there are several databases (mdb files) for several users (database table structures are same but data are different).
At one point of time, I decide that I shall combine all users' records into single database (mdb) file.
Now my question is, how do I combine all the records?
Because, in first mdb file, there are banks no. with 1,2,3 etc. and accounts depending on them. In second mdb file also, there are banks with no. 1,2,3 etc. Mere copy pasting won't do, because relational integrity will be violated.
I illustrated this problem with just two tables. But in my actual problem, there are 10 tables with relations among all of them.
Could you please help?
Thanks a lot.
Life is a one way journey, not a destination. Travel it with a smile and never regret anything.
Yesterday is history, tomorrow is a mystery, today is gift - that's why we call it present.
-
Aug 22nd, 2002, 10:13 AM
#2
Hyperactive Member
If u want to combile all this tables into one, there is no other way u have to change the primary keys...................
!!!NobodyisPerfect......IamNOBODY!!!
How's your wife and my kids?.....
Never argue with an idiot. They drag you down to their level then beat you with experience!
Child says : Mummy mummy, can i play with grandpa ?
Mum says : NO, you have already dug him up twice.
Galahtec The VB Forum
-
Aug 22nd, 2002, 10:20 AM
#3
PowerPoster
Why not a table in a new mdb with all possible fields. Then use ado to read existing mdb's and write into new one. you could just throw in some text to flag fields that dont exist for entries.
-
Aug 22nd, 2002, 10:27 AM
#4
Thread Starter
Fanatic Member
I devised following crude way:
1. Open all mdb files
2. Change all main primary keys (eg. BankNo) so they become unique in combined mdb file
3. copy from source and paste to combined mdb file
The process will be quite tedious and inefficient.
Is the any other way out?
Well, if I assume that this condition may happen while I'm still at design phase, how can I design my database to handle this problem?
Life is a one way journey, not a destination. Travel it with a smile and never regret anything.
Yesterday is history, tomorrow is a mystery, today is gift - that's why we call it present.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|