DelphiのDBXトランザクションでSQLエラーメッセージを表示する方法

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

  •  14-11-2019
  •  | 
  •  

質問

これはしばらく前にこれをどこかに見たが、私は今それを見つけることができなかった。

いくつかのコンポーネント(TSQLDataset、TDataSetProvider、TclientDatasetまたはElse)のエラーイベントの1つは、データベースサーバ自体によって返されるエラーメッセージを与えることを覚えていますが、それを思い出すことはできません。

誰かが私が話しているのを知っていますか?

事前にありがとうございました。

役に立ちましたか?

解決

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