Bournemouth are Stanley's second league victims in the competition this season, after beating Huddersfield thanks to a late goal in the First Round.
They will go on to host Colchester United in the Third Round.
Barnsley will play Bristol City at Oakwell tomorrow, with the winner hosting either Scunthorpe or Sheffield Wednesday who play their replay at Hillsbrough on Wednesday.