A technical error dating back more than a decade has been cited as the cause of incorrect organ donation details being recorded in an NHS database.

On Sunday, the NHS Blood and Transplant (NHSBT) service issued an apology for the mix-up, in which some people were listed on the transplant database as being willing to donate organs that they did not agree to donate. All those whose preferences were incorrectly recorded had registered as organ donors via their driving licence application form.

The service said in a statement on its site that it would write to all those who may be affected to confirm their organ donation preferences. NHSBT said that there had been 21 cases over the past six years in which organs were taken from dead people, with their preferences having been incorrectly recorded beforehand. In all those cases, the families of the deceased approved the transplants.

According to NHSBT spokeswoman Maxine Walter, the incorrect recording of preferences can be attributed to "a technical programming error dating back to 1999". She said the mistake only related to the feed coming from the Driver and Vehicle Licensing Agency (DVLA).

"This programming error, once it got into the system, remained there," Walter said. "All those years we've been accepting registrations from the DVLA, the same technical error has amounted to not recognising some of the organ options that people were nominating — it was reading them as something different."

In a theoretical example of how the preferences could have become mixed up — she stressed that this was not a specific example in reality — Walter said: "If you had ticked, say, 'liver', and the next person had ticked 'liver' as well, it would always have come up as 'heart'."

Walter pointed out that the error did not affect all the options in the organ donor registration list, and did not "randomly jumble up the options".

The spokeswoman explained that NHSBT became aware of the error when it conducted a validation exercise to check all the data it held was correct. After a sufficient number of survey forms were returned, the service realised there was a pattern to incorrectly recorded preferences and identified the programming bug.

"By early March, we'd locked it down and knew what the problem was," Walter said. "We isolated it as soon as knew what the issue was. We are in the process of fixing it, but we are still checking records."