¿Cómo ver el mensaje de error SQL en la transacción DBX de Delphi?
Pregunta
He visto esto en algún lugar en hace un tiempo, pero no pude encontrarlo ahora.
Recuerdo que uno de los eventos de error en algún componente (Tsqldataset, tcatasetprovider, tclientdataset o el otro) me daría el mensaje de error devuelto por el propio servidor de la base de datos, pero no puedo recordarlo.
¿Alguien sabe de qué estoy hablando?
gracias de antemano.
Solución
TClientDataSet.OnReconcileError contains a parameter of type EReconcileError which includes the error message, context and code. This data contains the message from the database server.
Otros consejos
Of course EReconcileError only helps if that is the particular type of database error you have. For all errors first look at the E.Messaage string, which gives you a description of the problem. Not always the same as the exact server text i think - it dpends also which database driver you are using - I am more familiar with the TMySQLConnection, but it's still a DBExpress driver... Chris