Importing a Table does not Replace old?

DavidWRouse

Registered User.
Local time
Today, 14:51
Joined
Jul 24, 2003
Messages
42
When i import a table "tbl_OpenJobs (Using Transfer Database in a macro)
the imported table does not replace the existing table but a new table is generated "tbl_OpenJobs1"

I could write code to delete the Table first but the reason i don't want to is because if i delete the table and then the imported table fails for any reason then I am left with no Table at all.

How can i get the imported table to replace the old one without having to write more code to delete the first one. (If there is a table to import)
 
If you use VBA to import you could trap for Errors and roll back the import.


I find the Safest way to do this is to Leave the original table as is.

Import the new table (now named tbl_OpenJobs1)

Verify that it is correctly imported

Delete Old table

Rename new table
 
Tx

Thanks, That what i thought,

I thought there might have been a quicker way.

I was in a bit of a rush and needed to finish the bit of code,
Bodged it in the end.

But I agree with you and will code it that way, With some nice error txt etc,
 
Overwright method

You are importing "tableX" from database1 into database2. Instead of importing the table, open database1 and export to database 2, using the same table name. Access will ask you to confirm the overwright, and will replace the existing table in database 2.
 
Why not
a) Append existing data to backup table (after deleting existing backup records
b) Delete existing table
c) Import data

You now have new data in table without name problem. You have backup data set in caseof any failure. Process does not require any intervention

Len B
 

Users who are viewing this thread

Back
Top Bottom