ADO ACCESS = Key Violation

Delphi

10/12/2003

Alguem ae sabe usar key violation com ADO? tipo.. tenho no registro o nome BOLA, antes de gravar ele procura o nome BOLA, se achar da uma mensagem e nao grava, da focus no edit novamente.

Um abraço

Nelson


Njunior

Njunior

Curtidas 0

Respostas

Maicongabriel

Maicongabriel

10/12/2003

Você pode usar um Locate() ou um FindKey()

if Tabela.Locate(´CAMPO´, ´BOLA´, [loCaseInsensitive]) then
begin
  ShowMessage(´Valor já existe´);
  Campo.SetFocus;
end;



GOSTEI 0
POSTAR