with Query1 do
begin
Close;
SQL.Text:= 'SELECT * FROM alucurso '+
' WHERE alumno = '+QuotedStr(dbedit6.Text)+
' AND curso = '+inttostr(x)+
' AND plan = '+inttostr(p)+
' AND fecha = '+quotedstr (dbedit5.Text);
Open;
if not IsEmpty then
begin
MessageDlg('Datos EXISTENTE',mtError,[mbOk],0);
end;
end;