A device for fixing an object to a rail by way of a fitting (P1, P2, P3, P4) that is movable along the rail within a groove together with a sliding member and is provided with a retainer which can be sunk into at least one lateral groove cavity in the rail. The retainer is joined to a sliding member via a connecting element. The retainer is supported relative to the sliding member and/or a rotating element via at least one energy accumulator while the pressurized retainer is fixed relative to the rail in at least two vertical positions.