Come visualizzare il messaggio di errore SQL nella transazione DBX di Delphi?

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

  •  14-11-2019
  •  | 
  •  

Domanda

L'ho visto da qualche parte in così qualche tempo fa, ma non riuscivo a trovarlo ora.

Ricordo che uno degli eventi di errore in alcuni componenti (Tsqldataset, TDatasetProvider, TclientDataset o altro) mi darà il messaggio di errore come restituito dal server del database stesso, ma non posso ricordarlo.

Qualcuno sa di cosa sto parlando?

Grazie in anticipo.

È stato utile?

Soluzione

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.

Altri suggerimenti

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

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top