Results 1 to 4 of 4

Thread: Database developer's challenge - how to combine data from several databases?

  1. #1

    Thread Starter
    Fanatic Member sbasak's Avatar
    Join Date
    Aug 2001
    Location
    Globe Trotter
    Posts
    524

    Unhappy 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.

  2. #2
    Hyperactive Member Dinz's Avatar
    Join Date
    Jan 2002
    Posts
    359
    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

  3. #3
    PowerPoster
    Join Date
    Feb 2001
    Location
    Crossroads
    Posts
    3,046
    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.

  4. #4

    Thread Starter
    Fanatic Member sbasak's Avatar
    Join Date
    Aug 2001
    Location
    Globe Trotter
    Posts
    524
    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
  •  



Click Here to Expand Forum to Full Width