KEY VIOLATION
tenho uma tabela (FireBird), chamada TABELAS, a chave primaria e composta por dois campos TAB_COD e TAB_KEY
Tratei o ´onposterror´ assim
var
Action: TDataAction);
begin
ErroMens := E.Message;
if COPY(ErroMens,1,20) = ´KEY VIOLATION´ then begin
ShowMessage(´Chave duplicada!´);
Action := daAbort;
end;
mas está ainda dando o seguinte erro
violation of PRIMARY or UNIQUE KEY constraint ´PK_TABELAS on table ´TABELAS´
Tratei o ´onposterror´ assim
var
Action: TDataAction);
begin
ErroMens := E.Message;
if COPY(ErroMens,1,20) = ´KEY VIOLATION´ then begin
ShowMessage(´Chave duplicada!´);
Action := daAbort;
end;
mas está ainda dando o seguinte erro
violation of PRIMARY or UNIQUE KEY constraint ´PK_TABELAS on table ´TABELAS´
Nilson Junior
Curtidas 0
Respostas
Rocsadan
28/09/2003
begin
if Pos(´violation of PRIMARY or UNIQUE´,E.Message)>0 then
begin
showmessage(´Já existe este Cliente!´);
Action:=daAbort;
end;
end;
if Pos(´violation of PRIMARY or UNIQUE´,E.Message)>0 then
begin
showmessage(´Já existe este Cliente!´);
Action:=daAbort;
end;
end;
GOSTEI 0