[Gambas-user] how to manage mysql error in gambas ?

Benoît Minisini g4mba5 at gmail.com
Tue Mar 31 21:10:19 CEST 2020


Le 31/03/2020 à 18:27, Marc Guillaume a écrit :
> hi everybody,
> 
> I would like to use the mysql error handling when I try to make a mysql
> insert that generates a "Duplacate entry" error in mysql to be able to
> transform the query into an update of one of the table fields. But
> Gambas returns the -1 error whatever the mysql error generated. I can
> parse the mysql error message that is returned, but is there a way to
> retrieve the specific error number from MySQL?
> 
> Otherwise I'll try to use a stored procedure.
> 
> thanks for your help
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> 

The mysql error code is in the Connection.Error property.

Regards,

-- 
Benoît Minisini


More information about the User mailing list