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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restoring a DBF after an ill advised replace command

Status
Not open for further replies.

ontsjc

Technical User
May 17, 2000
113
I realize this will most likely elicit gales of laughter, but I'll ask anyway. Is there anyway to restore/undo the results of a replace command when entered on an unbuffered table from the command window. I think I know the answer, but I'm hoping I'm wrong.
 
No way I know of unless you copied your table immediately before the REPLACE.


mmerlinn

"Political correctness is the BADGE of a COWARD!"

 
If MyTable.BAK exists (most) of your data could be there.

Brian
 
ontsjc,
The answer is: No. There is no way.
Baltman's suggestion about a .BAK file could provide you with some data, if the table's structure has been changed any time. The more recent the change, the better chance you have. You could recover it by renaming the file from .bak do .dbf and if it had any indexes on it, just rebuild them. Otherwise, if you didn't take a back-up, you're burnt. Unless you have a way of repopulating the field you just over-wrote through some other means, which depending on what you did, and what data was there, you may or may not be able to do. I would expect you are in panic mode at this point, so anything is prefereable to nothing.
The key here: ALWAYS, ALWAYS, ALWAYS make a back up of a table before issuing data destructive commands on it, just in case you muck it up. I have done this a few times, but fortunaly, it was when I was building a table off of other tables, and I just had to start my process over. Every once in a while you accidentally bank an enter key, or click a mouse button when you don't mean to, and disaster strikes. It's worse than spilling coffee in your keyboard. :)
Best of luck.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
It's worse than spilling coffee in your keyboard

Not when your computer is a laptop and your keyboard isn't spill resistant...

Brian
 
Baltman,
Yes, but generally you can still have a *chance* at getting the HD out of it, and getting the data off of it... with a REPLACE ALL on unbuffered (or even buffered after TABLEUPDATE()) there is ZERO chance of getting it back.. :)

Just the optimist in me.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top