Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB General » View Thread |
Messages 1 to 2 of 2 total |
Insert Row Constraint error message?? |
Sun, Jun 25 2023 6:11 PM | Permanent Link |
Ian Branch | Hi Team,
D11.3.1, latest EDB. I have the following code covering the OnPostError for my Parts table: {code} procedure TPartsForm.PartsPostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); begin // Action := daAbort; // if (E is EEDBError) and (EEDBError(E).ErrorCode = EDB_ERROR_CONSTRAINT) then begin // TaskMessageDlg('Duplicate Data Entry!', 'The record you are trying to save in the ' + DataSet.Name + ' table has duplicate data.' + sLineBreak + 'The Part # and Bus Code combination has already been used and cannot be used again!' + sLineBreak + 'See the following error message for details.' + sLineBreak + EEDBError(E).ErrorMsg, mtError, [mbOK], 0); // end else _PostError(Action, E, DataSet); // end; {code} _PostError(Action, E, Dataset) handles other errors generally for other tables as well, but the Constraint handling is unique to particular tables. Hence being handled here separately. Even then I have generic constraint handling in the general handler just in case but this wasn't used either. Anyway, what I finding is that the constratint error is still being written to the System Events Log: "The unique constraint PARTNO for the table Parts has been violated (Duplicate key MGND3X/A,I found)" That is the EDB inbuilt constraint handling error message. I had expected that my handling that error in my code would preclude it being written up in the Log. Your thoughts/experiences/suggestions appreciated. Regards & TIA, Ian |
Sun, Jun 25 2023 7:13 PM | Permanent Link |
Ian Branch | OK. Ignore this one. I just realised I asked the same question 12 months ago.
Brain cells fading quicker than I thought. |
This web page was last updated on Saturday, May 4, 2024 at 12:54 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |