PC SOFT

GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEVWEBDEV e WINDEV Mobile

Inicio → WINDEV 2024 → Trap errors constraint with MySQL
Trap errors constraint with MySQL
Iniciado por guillermo, jan., 20 2006 8:23 AM - 1 resposta
Publicado em janeiro, 20 2006 - 8:23 AM
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 em janeiro, 23 2006 - 10:33 AM
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