[Gambas-user] Bug in Tableview

Eric Damron edamron at ...776...
Mon Feb 14 18:53:25 CET 2005


Benoit Minisini wrote:

>On Friday 11 February 2005 04:39, Eric Damron wrote:
>  
>
>>I think there's a bug in the tableview component.  I've included a
>>helpdesk project that I've just started.  To run the project you need a
>>MySQL server.
>>
>>1. Run the project.  It will bring up a logon form.
>>2. Enter a username/passoword that has rights to create databases.   It
>>will detect that the helpdesk database does not exist and ask you if you
>>want to create it.
>>3. Answer by clicking on the "Yes" button.
>>4. The program will create a database called helpdesk and twelve tables
>>before opening the main form. (Note: I have my screen set to 1162 X 864
>>resolution so the main form will appear too large if you run at a lesser
>>resolution.)
>>    
>>
>
>The following request failed when creating the database: 
>
>SUB CreateCALL()
>...
> strSQL = "ALTER TABLE `HelpDesk`.`CALL` MODIFY COLUMN `id` INTEGER  NOT NULL 
>DEFAULT 0 AUTO_INCREMENT;"
>  ' << Query failed: invalid default value for 'id' >>
>  ' when executing the previous request
>  hConnection.Exec(strSQL)
>END
>
>Which version of MySQL do you use ?
>
>Note that there are mistakes in your use of Table.Fields.Create(). The second 
>argument is the GAMBAS datatype of the field, not the database datatype. I 
>mean, it must be gb.Integer, gb.Float, gb.Date, gb.String or gb.Boolean, 
>period. And the third argument is only used with gb.String.
>
>Regards,
>
>  
>
Hi Benoit,

I'm using 4.0.21-4.2 on a Suse 9.2 box.  It never occured to me that the 
SQL might change for different versions of MySQL.  I've attached a copy 
of the project that does not have the DEFAULT 0 part of the SQL.

I see that I use gb.GeneralDate instead of just gb.Date.  Is this 
incorrect?  It shows up in the auto-complete list of choices so I just 
assumed that I could select it.  Anyway I've corrected my errors and 
retested the behavior.  It still has a problem.  If there are only two 
items in the tableview and you delete the top item and refresh the view 
the bottom item disappears even though it is the top item that was 
deleted from the database.

BTW I want to thank you for making gambas available.  I think it is 
already useful and the fastest way I've found to deliver high quality 
database applications to my users.

Thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: HelpDesk.tar.gz
Type: application/x-tar
Size: 19360 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20050214/b8bbeb01/attachment.tar>


More information about the User mailing list