  51 Oph is one of the few young Be stars displaying a strong CO overtone
emission at 2.3 microns in addition to the near infrared excess commonly
observed in this type of stars. In this paper we first aim to locate the CO
bandheads emitting region. Then, we compare its position with respect to the
region emitting the near infrared continuum. We have observed 51 Oph with AMBER
in low spectral resolution (R=35), and in medium spectral resolution (R=1500)
centered on the CO bandheads. The medium resolution AMBER observations clearly
resolve the CO bandheads. Both the CO bandheads and continuum emissions are
spatially resolved by the interferometer. Using simple analytical ring models
to interpret the measured visibilities, we find that the CO bandheads emission
region is compact, located at $0.15_{-0.04}^{0.07}$AU from the star, and that
the adjacent continuum is coming from a region further away
$0.25_{-0.03}^{0.06}$AU. These results confirm the commonly invoked scenario in
which the CO bandheads originate in a dust free hot gaseous disk. Furthermore,
the continuum emitting region is closer to the star than the dust sublimation
radius (by at least a factor two) and we suggest that hot gas inside the dust
sublimation radius significantly contributes to the observed 2 $\mu$m continuum
emission.
