Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

undeleting records in a table

Status
Not open for further replies.

dickmaguire

IS-IT--Management
Mar 5, 2003
3
IE
Have database with single table which has had records deleted malisciously. If I open up database in something like textpad I can see the records so I know they still exist. Is there any way to reactivate them ??
 
Not sure how you can 'read' records from WordPad iunless you are using an attached table to a text file.

If that is the case, have you tried to re-link?

Please elaborate.

Sam_F
"90% of the problem is asking the right question.
 
Not sure how you can 'read' records from WordPad unless you are using an attached table (to a text file).

If that is the case, have you tried to re-link?

Please elaborate.

Sam_F
"90% of the problem is asking the right question.
 
Thanks for replying.

This table is very simple ie. only 4 fields. The table was opened sorted by one field and a specific group of records were deleted with the delete key.

Obviously the can not be seen anymore. But if I open textpad and open the DB like I would a text file and text search for text I know is only in these records I find them all still there but just deactivated. Is there a piece of code or an existing tool to reactivate these records.
 
Dick:

Not sure what you mean by "you can see them but they are 'de-activated' "...

If you can 'see' the records in textpad, can you just copy them and paste back into the table?

In trying to duplicate this, I created a one-table database, added records, closed it, and opened it in TextPad. Using either hex or text to view the mdb file, I cannot find any of the records in that table, even though they are still there.



Sam_F
"90% of the problem is asking the right question.
 
I think what Dick is saying is that, altough the .mdb is a binary file, there are always traces of clear text where the records are stored--unless the db is encrypted, which I'd say this isn't.

So you might see a few chunks of a string, interrupted by gibberish, then more of that record. I've been down the same route. The bottom line is 'No'. You can't retrieve these. If it were the table itself, and you hadn't closed Access, then yes, a deleted table is retrievable, but not individual records. A backup is the only solution here.
--Jim
 
There must be a tool available to do this. Until the database is compacted the records are still present - they are just marked for deletion and not displayed in the table's datasheet view.

Ed.

Please do not feed the trolls.....
 
Sam_f, I don't quite see your point. Your reference says:
Access does not release the space used by the old records until the database is compacted.
This is correct. Data is not physically deleted until a compact.

 
I will muddy the waters. I believe Access sometimes removes completely and sometimes not. If memory serves, when you do a Docmd.Runsql "Delete From blah_blah", the query runs somewhat slower than when you create a query with identical sql and run it. This was because Access completely deletes with the first method, and just clears the 'active' flag for the record in the second.

I believe can be borne out (I haven't tested it yet, but if it's a rainy weekend I just might) by seeing how a database can grow by importing/deleting the same set of records over and over using one method, then the other. With one method, the db grows, with the other, it does not--or at least not as much.
--Jim
 
BNPMike:

Well, it really isn't 'my' point, but the reference I quoted does seem to say that the records 'are' deleted immediatley and permanently. Not really sure what he means by the 'space' not being released until the PACK command, but that does not lead me to beleive that deleted records may be recovered.

Pretty esoteric... but interesting.

Sam_F
"90% of the problem is asking the right question.
 
Records are never deleted immediately. This I am sure of.

Ed.

Please do not feed the trolls.....
 
No system ever deletes records. It's a waste of time. All systems mark the records as deleted or remove them from the list of undeleted things. However there must be a process of recovering garbage. You would imagine a typical database, which has to have pages in real storage, would look on current in-store pages for any deleted space when it is asked to insert a new record. You would imagine the database would keep a deleted list on each page. Before inserting, it would check any space on the deleted lists. It would then overwrite the deleted records with new records, and - BAM - your data's gone. And others do. But not Jet. It always inserts at the end of the total tablespace. Thus your data is theoretically recoverable until you do a compact, whereupon the whole database is unloaded and re-loaded.

You must be able to read deleted data because as an example the Ability Suite Database reads and writes entire mdbs. You probably need to get some Bulgarians on the job of hacking the database file.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top