Как просмотреть сообщение об ошибке SQL в транзакции DBX DELPHI?

StackOverflow https://stackoverflow.com/questions/9504864

  •  14-11-2019
  •  | 
  •  

Вопрос

Я видел это где-то в так дарок назад, но я не мог найти это сейчас.

Я помню, что одно из событий ошибок в некоторых компонентах (tsqldataSet, tdataSetprovider, tclientdataset или ellig) даст мне сообщение об ошибке, как возвращено самим сервером базы данных, но я не могу вспомнить его.

кто-то знает, о чем я говорю?

Спасибо заранее.

Это было полезно?

Решение

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.

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top