Play was halted for 25 minutes after lightning struck one of the floodlights, plunging the ground into darkness.
Club officials eventually managed to get three of the four floodlights working to see out the remaining 15 minutes of the match and Frampton struck after 84 minutes, lashing home from just inside the area after a weaving run from Kevin Saint-Luce.
Jamie Allen had opened the scoring after 34 minutes with his first goal for Rochdale. The 18-year-old volleyed home from 10 yards when Matt Lund headed Michael Rose's deep cross back into the mix.
The home side had a couple of penalty appeals waved away by referee Iain Williamson, who booked Matt Done for simulation following a clash with Callum Kennedy before brushing aside Rochdale shouts when Alan Bennett appeared to handle the ball in a challenge with Allen.
Rochdale's frustration grew when the visitors equalised in the 53rd minute. Dale failed to clear Kennedy's free-kick and the ball dropped invitingly for Sammy Moore at the back post as he finished with a well-struck half-volley across the face of goal.
Harry Pell curled a shot inches wide of the upright before the storm intervened, with Frampton's late strike proving decisive for the Dons, who also had Ross Worner to thank for a superb save from Ian Henderson's shot.