Topic: Replace System Dialog Message with Own Error Message
Hello MVD,
I'd like to replace the following error with my own Message, it happens when you use the SendMail function
and it takes too long to resolve. The e-mails actuallly are sent after a little delay but this read timed out error
shows up. I'd like to replace that message with my own to le the user know that the e-mail will still be sent
out. Thanks!
P.S. I tried using the function below to adapt it but could not work it out:
// global event for all exceptions related database
function OnSQLException(Sender: TObject; Msg: string; SQL: string): boolean;
begin
// exception from button Form1.Button6
if Sender = Form1.Button6 then
begin
if Pos('FOREIGN KEY constraint failed', Msg)=1 then
begin
result := True; // to prevent system message
MessageBox('Selected record contains...', 'Error', MB_OK+MB_ICONWARNING);
end;
end;
end;[img]
[/img]