[Gambas-user] GRIDEDITOR

Pino Zollo pinozollo at ...626...
Sat Apr 26 00:09:42 CEST 2008


Alle 09:27, venerdì 25 aprile 2008, hai scritto:
> To make combo's editable, I think it's a case if switching TRUE to FALSE on
> your call...

Hi,
I have tried both: TRUE and FALSE but no change at all.

Any how I have discovered why at the moment of updating, my program get
 stuck. See the following trace of the queries produced:

DBConnection.Exec.117: SELECT * FROM qso
DBConnection.Exec.117: ROLLBACK
WARNING:  non c'è nessuna transazione in corso
DBConnection.Exec.117: BEGIN
DBConnection.Exec.117: UPDATE qso SET distance='EM0Uxxxx' WHERE qso_number
=873    <---WRONG, must be call='EM0...

The error is in the name of the field 'distance': it must be 'call' ...so a
string is assigned to a float field.

The error is general...it appens also for the other two editable columns, the
3rd and 4th.
See the following:
------------------------

DBConnection.Exec.117: SELECT * FROM qso
DBConnection.Exec.117: ROLLBACK                 <--- useless, generates the
following worning
WARNING:  non c'è nessuna transazione in corso
DBConnection.Exec.117: BEGIN
DBConnection.Exec.117: UPDATE qso SET band='PSK' WHERE qso_number =873
<---WRONG, must be SET mode = 'PSK'
DBConnection.Exec.117: UPDATE qso SET call='11m' WHERE qso_number =873
<---WRONG, must be band = '11m'
DBConnection.Exec.117: COMMIT
DBConnection.Exec.117: SELECT * FROM qso
DBConnection.Exec.117: ROLLBACK               <-- useless,
WARNING:  non c'è nessuna transazione in corso
DBConnection.Exec.117: BEGIN
DBConnection.Exec.117: UPDATE qso SET call='11m' WHERE qso_number =874 <---
WRONG
DBConnection.Exec.117: COMMIT
DBConnection.Exec.117: SELECT * FROM qso
DBConnection.Exec.117: ROLLBACK
WARNING:  non c'è nessuna transazione in corso
DBConnection.Exec.117: BEGIN

-------------
It happens that:
             $resultSet.Fields[Col].Name
it gives the wrong name.

Here is why:

This is the definition of my table made of 53 items:

CREATE TABLE qso (
   ADDRESS      text,
   DISTANCE     real ,
   ARRL_SECT	varchar(3),
   BAND         varchar(5) NOT NULL,
   CALL         text NOT NULL,
   CNTY		text,
...... 53 in total

DBGridEditor.GridEditor_Update.313: address    for Col = 0
DBGridEditor.GridEditor_Update.313: distance   for Col = 1
DBGridEditor.GridEditor_Update.314: arrl_sect         ........2
DBGridEditor.GridEditor_Update.315: band	          ........3
DBGridEditor.GridEditor_Update.316: call	          ........4
DBGridEditor.GridEditor_Update.318: cnty                ........5


--> Col is not the column in GridEdit, but the order in the definition of the
database.
--> There is no garantee that the same order is respected !!
--> In my case I have four columns in GridEdit out of 53 in the table in
random order.
...
So it takes to remember the real names of the columns used for been edited.

Regads

Pino

-------------------------------------------------------




More information about the User mailing list