The Bonding - S3-E5
Other mistake: It is said that Jeremy Aster's father died five years prior to the events of this episode. However, Jeremy watches a family video recorded by his father in which Jeremy looks exactly the same as he does in the present: a twelve-year-old, when he should be no older than seven.





Answer: Yes. The doors to the holodecks can be locked when in use by anyone aboard the Enterprise so they couldn't be disturbed. However, high ranking officers like Captain Picard could override the doors as it's seen that overrides are in use even for the crews quarters. Even Barclay, when he's indulging in one of his fantasies could have the doors to the holodeck unlocked by an override code.