Quick Question

pfiroz

Registered User.
Local time
Today, 12:18
Joined
Jan 21, 2009
Messages
27
I'm sure this is an easy one but what is the best way to import a table and replace an existing table with it. I know I can use the import data option in a database. I was just going to import the excel file, delete the original table, rename the newly imported table the same name as the old one. Will this break links / associations in the database?
Is there a better way to do this?
Appreciate any help!!
:)
 
rename the orignal table FIRST, then import the new one as the old name
 
Also ... make sure that no other objects are open when you're doing this else, particularly in the case of queries, corruption could quite easily arise.
 
If you have relationships it may cause a problem. Why not do a Delete query to clean out the original table and then Import to the real table. Do a macro to do the 2 steps and all is good.
PatM-Reno, NV USA
 
Ahh well that sounds like the for sure way to avoid problems!! What would that macro look like. I'm not very experienced with macros...
 
1. Write a Delete action query to clean up the table.
2. You will need to Actions in the macro.
3. First action, "open query", the below choose your delete query. That will run it and delete the data in the table.
4. Next you might want to do an Import spec on your Excel sheet and save it then use the action in the macro to 'TransferText' to import the data using your saved Import spec.
5. This could all be done with code but this works fine.
Pat
Now I really must go back to work but I love this forum!
 

Users who are viewing this thread

Back
Top Bottom