PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → Trap errors constraint with MySQL
Trap errors constraint with MySQL
Iniciado por guillermo, 20,ene. 2006 08:23 - 1 respuesta
Publicado el 20,enero 2006 - 08:23
Hi forum...
I generated a project with an analysis, I put all the files via OleDb with a connection MySql.
When the project runs, all files in the Database are created.
After, with the MySQL Administrator, I generated the constraints.
How can I trap the error, eg. attemp to delete a parent record that contains child associated ?
With HF I use HOnError("*",hErrIntegrity,Integrity), but now I'm lost
Guillermo
Publicado el 23,enero 2006 - 10:33
I solved it in the following way
in the GlobalDeclaration of the form
WHEN EXCEPTION
elMensaje is string = ExtractString(ExceptionInfo(errMessage),2,CR)
elMensaje = ExtractString(elMensaje,2,"=")
SWITCH NoSpace(elMensaje)
CASE "170133"
Info("No se puede eliminar el registro porque tiene"," registros asociados en otra tabla"...
,"Verifique")
END
ExceptionEnable()
END
Guillermo
Hi forum...
I generated a project with an analysis, I put all the files via OleDb with a connection MySql.
When the project runs, all files in the Database are created.
After, with the MySQL Administrator, I generated the constraints.
How can I trap the error, eg. attemp to delete a parent record that contains child associated ?
With HF I use HOnError("*",hErrIntegrity,Integrity), but now I'm lost
Guillermo