Drive for a leaf of a window or a door, having a housing, an electric-motor drive unit for actuating the leaf and an electronic control unit for activating the electric-motor drive unit, wherein a blocking element is provided, which can be displaced between a blocking position, in which actuation of the leaf is prevented mechanically by blocking the electric-motor drive unit, and a release position, in which the electric-motor drive unit for actuating the leaf is released mechanically, wherein a locking device that can be displaced between a locked state and an unlocked state is provided which, in the locked state, holds the blocking element in the blocking position and, in the unlocked state, permits the blocking element to be displaced out of the blocking position into the release position, wherein the locking device has an access safeguard, so that the locking device can be displaced from the locked state into the unlocked state only when access authorization is given, and wherein a detector connected to the electronic control unit is provided, which is designed to detect whether the blocking element is assuming its blocking position, wherein the drive is designed in such a way that activation of the electric-motor drive unit is prevented when the detector detects the blocking position of the blocking element, and wherein the electric-motor drive unit comprises a spindle gear driven by means of an electric motor and having a spindle and a spindle nut, via which the leaf can be actuated, characterized in that the access safeguard comprises a mechanical locking system that can be actuated by a key, in particular a lock cylinder, in that the locking device comprises a locking section which, in the locked state, engages with a form fit in an engagement recess in the housing, in particular a base plate of the housing, the engagement being released in the unlocked state, and in that the spindle nut of the spindle gear of the electric-motor drive unit can be blocked by the blocking element in the blocking position of the latter for the mechanical prevention of an actuation of the leaf, and the spindle nut can be released with a displacement of the blocking element into the release position of the latter. wherein a locking device that can be displaced between a locked state and an unlocked state is provided which, in the locked state, holds the blocking element in the blocking position and, in the unlocked state, permits the blocking element to be displaced out of the blocking position into the release position, wherein the locking device has an access safeguard, so that the locking device can be displaced from the locked state into the unlocked state only when access authorization is given, and wherein a detector connected to the electronic control unit is provided, which is designed to detect whether the blocking element is assuming its blocking position, wherein the drive is designed in such a way that activation of the electric-motor drive unit is prevented when the detector detects the blocking position of the blocking element, and wherein the electric-motor drive unit comprises a spindle gear driven by means of an electric motor and having a spindle and a spindle nut, via which the leaf can be actuated, characterized in that the access safeguard comprises a mechanical locking system that can be actuated by a key, in particular a lock cylinder, in that the locking device comprises a locking section which, in the locked state, engages with a form fit in an engagement recess in the housing, in particular a base plate of the housing, the engagement being released in the unlocked state, and in that the spindle nut of the spindle gear of the electric-motor drive unit can be blocked by the blocking element in the blocking position of the latter for the mechanical prevention of an actuation of the leaf, and the spindle nut can be released with a displacement of the blocking element into the release position of the latter.