[Gambas-user] how to manage mysql error in gambas ?
Marc Guillaume
alarch at alarch.pw
Tue Mar 31 22:12:04 CEST 2020
Le Tue, 31 Mar 2020 21:10:19 +0200,
Benoît Minisini <g4mba5 at gmail.com> a écrit :
> 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,
>
Thank you!
I hadn't seen that connection object property.
More information about the User
mailing list