he probado con el codigo que me has dado y con otros, y en la mayoria me sale el siguiente error:
Código:
adoquery1: parameter 'pficha_cpu'not found
Código Delphi
[-]
adoquery1.sql.text := ' select ficha_cpu from tcpu where ficha_cpu =:laficha'; adoquery1.parameters.ParamByName('laficha ').value := dbedit1.text;
adoquery1.Open;
if not adoquery1.IsEmpty then
begin ShowMessage('el dni ya existe');
sysutils.Abort;
end;
Código Delphi
[-]
with Adoquery1 do
try
Close;
ParamByName('pficha_cpu').AsString := Dbedit1.Text;
Open;
if not isEmpty then
begin
MessageBox(Self.Handle, 'Cédula existente', '', MB_ICONERROR + MB_OK);
DBEdit1.SetFocus;
Abort;
end
finally
Close;
end;
end;
Código Delphi
[-]
with Adoquery1 do
try
Close;
adoquery1.parameters.ParamByName('pficha_cpu').AsString := Dbedit1.Text;
Open;
if not isEmpty then
begin
MessageBox(Self.Handle, 'Cédula existente', '', MB_ICONERROR + MB_OK);
DBEdit1.SetFocus;
Abort;
end
finally
Close;
end;
end;
Código Delphi
[-]With tcpu do
begin
if Locate('ficha_cpu', DBEDIT1.TEXT,[]) then
Begin
application.MessageBox('Este ficha ya fué registrada',' ');
End
else
Begin
Dbedit1.setfocus;
Abort;
end
else
tcpu.Post;
end