[Gambas-user] DATABROWSER FAILS TO UPDATE

ron ronstk at ...239...
Tue Jan 22 09:22:33 CET 2008


On Tuesday 22 January 2008 04:42, Nx GT-R BOY wrote:
> DATABROWSER FAILS TO UPDATE
> 
> Hi, I have a problem with the refresh of the databrowser, what I am doing is
> to ADD a value to a GIVEN record with a function, the function would look
> more complex, so I think is better to write here just the MySQL code:
> 
> mysql> update some_table set some = some + 1 where code=1;
> 
> I do that from a function that I call from a simple button from my GUI, but
> the DataBrowser doesnt update the value of <some> field.
> 
> What I need to do is close the form, and call it again, for the refresh
> takes effect, because the "refresh" button does nothing.
> 
> Is there any suggestion to make the "update process" (from GUI) more nicely?
> 
> 

Gambas uses the snapshot method on a sql request.
The description geven by you is correct.
Wich refresh button do you mean? If it is in the IDE
then the button is for refreshing you gambas project
editor and not your running program.
You need to implement a refresh in your application program
on the Result recordset after every update not done
with the edit function into this same Result.
 
Remeber everyone else _can_ update the same or other record
without locking the table you are using a database.

The only sgestion is do the increment of the field using
the same Result or do not keep the Result open all the time.

Open and Close in gambas is not strictly Open and Close the 
table in a database, and lock everyone else out, but more the 
connection to the database.
Seperate handling the same table with different subroutines
does not update a made Result in other subroutines automatic. 

Ron 




More information about the User mailing list