Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cursor Adapter and multiple row updates
Message
From
18/05/2005 12:56:20
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01015225
Message ID:
01015438
Views:
22
Marcel,

>How do you deal with error handling when you update multiple rows using a cursoradapter?
>
>Let's say I have 2 cursoradapter. One with Row buffering (CA1) and one with Table buffering (CA2).
>I want to do multiple updates. First I update the multiple rows for CA2, then the single row for CA1. If updating CA1 generates an error, can I use Transaction Rollback to Revert all records in CA2?

You would need to turn off the CA.UseTransactions property, which is true by default and handle the transactions manually, just as you might for doing SQL Passthrough (for remote) or buffered VFP tables.

You could have a master controlling class that instantiates and controls each CA involved and wraps a transaction around the updates, using the transaction capabilities on the ODBC connection if for remote data or BEGIN TRANSACTION, etc if VFP tables.

Sorry, but I don't have an example to show you right now, because I'm in the middle of working this out right now for a project.
David Stevenson, MCSD, 2-time VFP MVP / St. Petersburg, FL USA / david@topstrategies.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform