Delphi의 DBX 트랜잭션에서 SQL 오류 메시지를 보는 방법은 무엇입니까?

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

  •  14-11-2019
  •  | 
  •  

문제

나는 몇시 전에 어딘가에있는 것을 보았지만 지금 그것을 찾을 수 없었습니다.

일부 구성 요소 (tsqldataset, tdatasetprovider, tclientdataset 또는 else)의 오류 이벤트 중 하나는 데이터베이스 서버 자체가 리턴 된 오류 메시지를 제공하지만 그것을 기억할 수는 없습니다.

누군가 내가 무엇을 말하는지 알고 있습니까?

미리 감사드립니다.

도움이 되었습니까?

해결책

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