An attaching structure of a rotation-detecting sensor comprises (a) a
rotation-transferring medium, (b) a rotation-detecting sensor having (b1)
a detection portion that detects a variation in magnetic field due to the
rotation of the rotation-transferring medium to convert the variation
into an electric signal and (b2) a main body having a plurality of side
faces, (c) a flange that is provided at at least one side face of the
main body of the rotation-detecting sensor, (d) an attaching member for
the rotation-detecting sensor, the attaching member having an attaching
hole into which the main body is inserted, concurrently with the flange
being applied to the attaching member, and (e) a resin-molded body that
(e1) covers by resin molding at least one part of the flange and a part
of the attaching member to embed them in it and (e2) fixes the main body
of the rotation-detecting sensor to the attaching member through the
flange. The attaching hole of the attaching member also positions the
rotation-detecting sensor. Even when the attaching hole is not filled
with the resin-molded body because of the above-described positioning and
the resin-molded body fails to achieve sufficient supporting force, the
flange can securely fix the rotation-detecting sensor to the attaching
member, because the flange is embedded in the resin-molded body and
therefore can exercise the anchoring effect.