As "successor states", as opposed to "new member states", "A" & "B" would only require a majority of the 27(8) to approve continued EU membership in their revised constitutional form. No single member, e.g. Spain, would have a veto.
That would seem to be open to debate. Paper from 2001 by the The Esme'e Fairbairn Charitable Trust.
Scotland's Place in Europe
Conclusions:
a The Vienna Convention on State Succession in Respect of Treaties was drawn up against a colonial background and lays down the rules relating to newly independent States (which are given a clean slate) and other successor States (which are presumed to succeed automatically to the treaty heritage of their predecessors), which do not accurately reflect customary law and have not proved generally acceptable.
There is no automatic right to membership of the European Union. State succession to treaties has to be governed by the nature of the treaty. Continued cover by the EU Treaty of the Scottish territory would thus only be possible with the approval of all Member States.
Realistically, Scotland can expect - more or less automatically - negotiations for EU membership to begin before independence is gained. In the event that the negotiations are not completed at the date of independence there would probably be a continuation of the imposition of the acquis on an agreed basis until negotiations are completed and all sides ratify the agreement.
Should all negotiations fail, Community regulations and directives would continue to apply in Scotland as they are part of Scots law by virtue of the European Communities Act 1972 as amended. Scottish nationals and companies would, however, lose EU rights elsewhere in Europe (including UK).
However, Scotland would be under no legal obligation to adopt any future EC legislation or follow any decisions of the ECJ. Moreover, the provisions of the EU Treaty would cease to be binding on Scotland and its citizens.