Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Real VFP Tablerevert()
Message
From
11/02/2008 22:12:43
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MySQL
Miscellaneous
Thread ID:
01291359
Message ID:
01291693
Views:
14
Naomi,

In DataSession 1, I created a VFP Cursor from a Cursoradapter which gets its data from a MySQL table. I have set all there is to set to make it updatable. Its Buffermodeoverride is 5 - optimistic table buffering. I then made modifications to this cursor - edits, deletions and appends.

In the MySQL client, I intentionally locked some records in the server side.

Back to DataSession 1. I issue TABLEUPDATE(.T.), which obviously failed. So, I issued a TABLEREVERT(.T.). NOT ALL records were reverted back to its original state. Those that were 'successfully sent' to the server could not be reverted back.

I have no problem with the server side as I have put SQL sends to commit and rollback in the AfterCursorUpdate event.

What I want to happen is an "all or nothing" scenario - if any record update fails, then none gets updated - in the VFP side.

The workaround I did was to just do a CursorRefresh() to fetch back the original records. Is this the ONLY way?

Thanks!

Dennis





>Dennis,
>
>Your question is unclear. Did you verify that you really saved your records with tableupdate(), e.g. what did this function return?
>
>>Hi All,
>>
>>I have a cursoradapter with BufferMoodeOverride = 5, table buffering.
>>
>>I did a TABLEUPDATE( .T. ), which updated several records to the data source.
>>
>>Problem is, if with 10 new records, then we attempt to save with TABLEUPDATE()... only the first 5 records were saved... the local cursor then shows the first 5 as not a new record!
>>
>>Is there a workaround for a 'REAL TABLEREVERT(0)'??
>>
>>tHANKS
>>
>>dENNIS
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform