Undelete

mr moe

Registered User.
Local time
Today, 02:43
Joined
Jul 24, 2003
Messages
332
Can someone please help. I have deleted a table, I do know for 100% that I can undelete the table since that I haven't closed or compated the database yet, I have done that in the past, but I forgot where I put the code for that. Please help!
 
I saved this from somewhere just incase I needed it...

You can "sometimes" retrieve the data from a deleted table if you have not exited the database or compacted/repaired the database since the time the table was deleted.

Access renames and hides deleted objects. Open or query the MSysObjects table and look for a table named something like "~TMPCLP171451" and with a Type of 1.

To find the names of all tables in your database you need to create a new query:
Do not select a table, close the table selector.
Go into the SQL view and copy and paste this:
SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Name) Not Like "MSys*") AND ((MSysObjects.Type)=1));

That SQL will list all of the tables in your database and hopefully you will see one prefixed with a tilde ~

To retrieve the data from the deleted table you need to create a new query using SQL like this:

SELECT * FROM [~TMPCLP171451]

Substitute the above [~TMPCLP171451] with the name of your deleted table and remember to use brackets since the deleted table name is prefixed with ~

You should be able to "make a table" with that data and hopefully recover the data from the deleted table.
Please post back if this works for you!
 
Last edited:
mr moe said:
Can someone please help. I have deleted a table, I do know for 100% that I can undelete the table since that I haven't closed or compated the database yet, I have done that in the past, but I forgot where I put the code for that. Please help!

Hate to state the obvious but if you haven't closed the db have you tried edit--undelete table?
 

Users who are viewing this thread

Back
Top Bottom