try
.
.
.
except
On E: EDBEngineError do
begin
Database1.Rollback;
for i := 0 to E.ErrorCount - 1 do
begin
case E.Errors.ErrorCode of
$2601:
begin
beep;
ShowMessage('呵呵!我不允许鍵值重覆!');
end;
$0021:
begin
beep;
Showmessage('太糟糕了,系统发生故障!TMD');
end;
$270b:
begin
beep;
Showmessage('对不起,你的受到主外键约束!怎么样,很失望吧!');
end;
$2b05:
begin
beep;
Showmessage('太糟糕了,网络连接超时判负!TMD');
end;
$0028:
begin
beep;
Showmessage('琐定违例!');
end;
$1200:
begin
beep;
Showmessage('不能识别的SQL错误!呵呵,有事干了!');
end;
$2501:
begin
beep;
Showmessage('太糟糕了,你的内存不足!请使用N(N>=10000)兆内存');
end;
$2605:
begin
beep;
Showmessage('对不起,你所添加的数据违反外键约束!');
end;
$2728:
begin
beep;
Showmessage('你所操作的表不存在!');
end;
$2801:
begin
beep;
Showmessage('记录已经被其它用户琐定!');
end;
$2a06:
begin
beep;
Showmessage('数据引擎初始化错误!');
end;
$2c01:
begin
beep;
Showmessage('网络初始化失败!');
end;
$2c07:
begin
beep;
Showmessage('呜呜..呜呜!一个我不知道的网络错误,这不可能!');
end;
$2c0d:
begin
beep;
Showmessage('是谁干的!!服务器竟然没打开!');
end;
$3e07:
begin
beep;
Showmessage('初始化失败!');
end;
$3303:
begin
//ShowMessage('服务器端错误:一般的SQL错误!');
end;
else
raise EDatabaseError.Create(E.Message);
end;//case
end;//for
end;//on EDBError
end;//try..except