[Gambas-user] Use of db.Begin, db.Commit and db.Rollback with a

T Lee Davidson t.lee.davidson at ...626...
Wed Jan 21 00:17:30 CET 2015


Well, looks like I was wrong again.

Despite the documentation for DataSource.Update saying,
"Reload the DataSource data and update all bound child controls accordingly,"
it apparently tries to write to the database.

The .Cancel method is the one to use to, uh, cancel any current modifications.
DataSource.Cancel: "Cancel any current edition of child controls."


Simple sample attached.


Lee
__________

"Artificial Intelligence is no match for natural stupidity."

On 01/20/2015 01:55 PM, T Lee Davidson wrote:
> Martin,
>
> I must apologize for slightly misleading you.
> The .Update method is the more appropriate one to use to reload the data in the event of a canceled edit.
> The .Update method can be applied to the DataSource and it will update all bound children.
>
> And, yes, logically, if you create a record and then do not populate it with data, you would have added a blank record to the DB.
> But it really depends on how you create the record to begin with.
>
> For example, the clicking the "New" button in the Databrowser does not create a new record in the database until the data is "Save"d.
>
>
> Lee
>
> On 01/20/2015 08:19 AM, Martin McGlensey wrote:
>> Lee,
>>
>>
>>
>> Thanks for your response. Yes I'm working with only one record at a time.
>> I'm unclear as to where to use the refresh method.  The form is used to
>> input data including name, address , phone and state. There is the
>> possibility that multiple datacontrols may be changed at one time. Must I
>> use the refresh method with each datacontrol or can I apply it to the
>> datasource? I've tried refreshing the datasource, in the cancel function,
>> but that does not seem to work. There is got to be a way of refreshing all
>> datacontrols on a form. One other question - If I create a record intending
>> to add data and then cancel by not updating the datasource is a blank record
>> added to the table?
>>
>>
>>
>> Thanks
>>
>> ------------------------------------------------------------------------------
>> 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 at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DatabaseSample-1.0.1.tar.gz
Type: application/x-gzip
Size: 12052 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20150120/4895fa3c/attachment.bin>


More information about the User mailing list