Updating data in an Access database on the web
November 3, 2005 7:40 AM
How do I import data into a table in an Access database in such a way that the new table will retain all of the relationships currently extant in the database? Is there a way to make a new table and overwrite the old table (say the table is called 'users') and preserve the relationships?
Sorry. "see here" above should be see here [link added]
posted by paulsc at 8:06 AM on November 3, 2005
posted by paulsc at 8:06 AM on November 3, 2005
paulsc is describing how to move a table from one database to another.
i'm not sure that's what you asked. but to me what you asked makes no sense, because you seem to be asking "how can i change a table so that it is the same as it was before it was changed".
posted by andrew cooke at 8:07 AM on November 3, 2005
i'm not sure that's what you asked. but to me what you asked makes no sense, because you seem to be asking "how can i change a table so that it is the same as it was before it was changed".
posted by andrew cooke at 8:07 AM on November 3, 2005
Import your new data into a temporary table.
Clear the data in the existing table, but don't delete the table - as this will destroy all your relationships.
Run an append query to put all of the new data into the empty table from the temporary one.
Clear your temporary table (just good housekeeping; not really necessary)
Put all of the above into a macro if you're going to do this regularly, so that the whole process becomes somewhat easier to perform!
Rinse, repeat, wipe hands, profit (and whatever other cliches are relevant!)
posted by Chunder at 8:07 AM on November 3, 2005
Clear the data in the existing table, but don't delete the table - as this will destroy all your relationships.
Run an append query to put all of the new data into the empty table from the temporary one.
Clear your temporary table (just good housekeeping; not really necessary)
Put all of the above into a macro if you're going to do this regularly, so that the whole process becomes somewhat easier to perform!
Rinse, repeat, wipe hands, profit (and whatever other cliches are relevant!)
posted by Chunder at 8:07 AM on November 3, 2005
As for your second question, well, that depends...
If any data elements in the original table are used or referenced in other tables, and if your database enforces referential integrity, no. An example of this would be if your current "users" table has something like a UserID field, which is a unique primary key, and is then used in other tables as a foreign key to unambiguously link the info in the "users" table to entries in the other tables for user related information.
Another reason the answer will be "no" in Access is if a primary key in your "users" table is autonumbering.
posted by paulsc at 8:19 AM on November 3, 2005
If any data elements in the original table are used or referenced in other tables, and if your database enforces referential integrity, no. An example of this would be if your current "users" table has something like a UserID field, which is a unique primary key, and is then used in other tables as a foreign key to unambiguously link the info in the "users" table to entries in the other tables for user related information.
Another reason the answer will be "no" in Access is if a primary key in your "users" table is autonumbering.
posted by paulsc at 8:19 AM on November 3, 2005
This thread is closed to new comments.
posted by paulsc at 8:04 AM on November 3, 2005