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

Recorset undo

Status
Not open for further replies.

prprogrammer

Programmer
Jun 25, 2004
49
PR
I it's possible to make a undo to a recordset deletion..
I use sql server 7 and vb 6
 
I don't know of any way to 'undo' a delete that has been committed to the database (outside of recovery from backup). But what you could do in code, if you want to give users and option to review what a delete would do is you could place the delete in a transaction, and not committ it until the user confirms it. If they don't confirm, don't committ. This would look like an undo to the user.

If your recordset is not connected- just don't apply the delete.

You could also try asking in the vb databases forum.
 
Putting delete's in and updates in transactions are also a great way of making sure that everything finishes before ending.

For isntance if you have a customer record that is linked to customer oders. You could transact the delete of a customer record then delete the customer orders. If deleting the customer orders fail you roll back the delete of the custoemr record.

Casper

There is room for all of gods creatures, "Right Beside the Mashed Potatoes".
 
This is just a side note. We logically delete our records by flagging them as deleted and excluding them after that via the flag. That way we always have the deleted data available. We can get away with it because we are a small shop and the volume of data is not that great.
 
The flag is also used on BIG shops.
Really depends on the level of security/history required.

Some shops will write the deleted record(s) to a history file, others will use the flag, others will creat a new version of the record and then flag the old one as "deleted".

And when I say BIG i am referring to banks and insurance companies.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
If you have two text boxes with one being txtFind and the other txtReplace you could update the database with the text in txtReplace after you have done a search for txtFind.

Then if you wanted to undo it you could now update the database with the contents in txtFind where the database field equals data from txtReplace.

If this doesn't make any sense then never mind.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top