como guradr sin duplicar
Publicado por eliza0_n (6 intervenciones) el 22/05/2005 19:47:30
Hola tengo un problema a la hora de guardar los datos en la tabla, son tablas parados, y lo me gustaria hacer es que no me duplique registros, mi llave es ‘serie’, el codigo que tengo es:
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
if DBEdit1.text<>'Serie' then
table1.Post;
table1.edit;
if DBEdit1.text='Serie' then
ShowMessage('YA EXISTE UN EQUIPO CON ESTE No. DE SERIE');
end;
todo va bien cuando le doy guardar un registro en el cual ‘Serie’ es diferente, pero cuando ‘Serie’ es igual, me marca error y se traba, me gustaria saber en que estoy fallando, ojala me puedan ayudar.
procedure TForm2.BitBtn1Click(Sender: TObject);
begin
if DBEdit1.text<>'Serie' then
table1.Post;
table1.edit;
if DBEdit1.text='Serie' then
ShowMessage('YA EXISTE UN EQUIPO CON ESTE No. DE SERIE');
end;
todo va bien cuando le doy guardar un registro en el cual ‘Serie’ es diferente, pero cuando ‘Serie’ es igual, me marca error y se traba, me gustaria saber en que estoy fallando, ojala me puedan ayudar.
Valora esta pregunta


0