添加ApplicationEvents控件,在

onException添加如下代码

if (E is EOleException) and ((E as EOleException).ErrorCode= -2147467259)
and ADOConnection1.Connected then
begin
ADOConnection1.Connected := False;
showmessage('异常断开');
abort;
end;