An electronic door lock is programmable to accept new valid data key devices using a special data key device from with a set of special data key devices used for programming and control purposes. The lock has a learn mode controller responsive to a learn data key device to enter into a new valid access data key learn mode. A valid access code recorder is responsive to a first previously unknown code contained in a first new data key device while in the learn mode to record the first unknown code as a valid access code for operating said lock. A cancel code recorder is responsive to a second previously unknown code contained in a second new data key device while in the learn mode to record the second unknown code as a cancel code paired with the valid access code of the first new data key device. In use, the lock is activated to open in response to the valid access code of the first new data key device, and is activated to cancel the recorded valid access code in response to the cancel code of said second data key device. The lock is able to operate with any data key device without requiring preprogramming specific to the lock. Programming and control is made easier by hierarchical distinctly labeled special data key devices used for specific corresponding programming and control purposes.