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

2015-01-21 Thread Lewis Balentine
Yep that seems to work. I did try that previously (I think) but it seems somewhere along the line I corrupted my database. I started over from scratch ... :-( Overall it has been a very enlightening exercise. Now what was I doing before I started this ? Lewis On 01/20/2015 05:17 PM, T Le

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

2015-01-21 Thread Martin McGlensey
Hello, Thanks for the replies. Tried the .update method. That does not work. Just returns an empty record. Finally wrote a small procedure to store the datacontrol values in an array sized by the number of controls on the form. (form.Children.Count) Then use a similar procedure to read the arra

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

2015-01-20 Thread T Lee Davidson
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. D

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

2015-01-20 Thread Lewis Balentine
Nope, you did not mislead me I was already been looking at these methods, but I had only tried the update function on a dataview control where the data was modified by an external program (that works nicely). I believe that I have tried every combination of: DataSource.Cancel, DataSource1

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

2015-01-20 Thread T Lee Davidson
I believe I have mislead you too, Lewis. My apologies. Look at DataSource.Update. Lee __ "Artificial Intelligence is no match for natural stupidity." On 01/20/2015 01:03 PM, Lewis Balentine wrote: > Mr. Speaker, > I request permission to revise and extend my previous remarks ... > > Pl

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

2015-01-20 Thread T Lee Davidson
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

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

2015-01-20 Thread Lewis Balentine
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 Contr

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

2015-01-20 Thread Martin McGlensey
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

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

2015-01-19 Thread Lewis Balentine
>> use the .Refresh method << That assumes that one is using data linked controls. That is not always the case: examples: a date record is displayed/edited as two separate text boxes (i.e. date and time) a person's name is stored in the fields: given_name, initial, family_name

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

2015-01-19 Thread T Lee Davidson
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

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

2015-01-19 Thread Martin McGlensey
Hello, I have a form containing a datasource linked to a MySQL database table. The datasource contains datacontrols to display the data from the underlying table. There are buttons for add, edit, save, delete and cancel. The add button creates a new record. The save button saves the record. The