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

How to rollback VFP client using SQL backend

Status
Not open for further replies.

vfpshe

Programmer
Jan 2, 2001
24
0
0
US
Please help me...

I have a front-end designed built in VFP and SQL 2000 for backend. I need to be able to rollback a transaction when user clicks the CANCEL button during processing.

Can anyone help me how to do this?

Thanks!
 
Have a look at the sqlrollback and sqlcommit commands.
 
Vfpshe,

The best way is to write a stored procedure to handle your update. Within the stored procedure, use BEGIN TRANSACTION, ROLLBACK TRANSACTION and COMMIT TRANSACTION commands.

The SP does not have to be elaborate - just a simple wrapper to include those commands.

Mike


Mike Lewis
Edinburgh, Scotland
 
Will pressing ESC while the transaction is being processed in SQL rollback any updates done?
 
VFPshe,

Will pressing ESC while the transaction is being processed in SQL rollback any updates done?

No. In fact, I didn't read your question carefully enough. Sorry.

The rollback feature I described is only good if an error or interruption occurs on the server. You can't use it to initiate a cancellation from the client.

I suggest you follow up Flutepir's suggestion instead.

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top