Mr. Speaker,
I request permission to revise and extend my previous remarks ...

Please see the attached sample application and data base. I used a SQlite Database but in theory these function should operate the same. I tried five ways to cancel the edits to a set of data controls.
    via Control Refresh
    via Data Source Refresh
    via Data Source Cancel
    via Closing the DB and reopening it
    via Data Control Tags

The only one that I found that worked was to restore the content from a copy saved in the data control tags. I note that changing the 'DataControl.Value' (either via software or manually) does not set 'DataSource.Modified' or "DataControl.Modified' properties to true. The operation was the same in version 3.6.2 and 3.6.9.

Then again maybe I am doing something(s) wrong .... :-\

Regards,

Lewis Balentine

On 01/19/2015 07:42 PM, T Lee Davidson wrote:
Hello Martin,

If you are working with only one record at a time, you don't need to use 
transactions.
Transactions are used when multiple records need to be modified in an all-or-none 
scenario, such as when a record, that is the "one" in a
one-to-many relationship, needs to be deleted.

In such a case, you would start a transaction with .Begin, delete the dependent 
records followed by the one record. Then, if all modifications
are successful, you would .Commit. If there is a failure at any time during the 
transaction, you would .Rollback.

To get the datacontrol to display the original data after a canceled edit, use 
the .Refresh method.


Lee
__________


Attachment: DBSample-0.0.1.tar.gz
Description: application/gzip

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to