Maybe some of Billy May's Mighty Putty? Hate to tell you, but sometimes there are no cheap ways to fix problems. I'm sure you don't want a hack job that will likely fail in the near future. I didn't quite understand what you said was a problem when you said the flange was glued to the PVC. Of course it is. Flanges are solidly attached to the drain. Cast iron is poured lead and oakum, PVC and ABS are solvent welded (that's glued in lay-speak) If the pipe or flange is broken, then it needs to be fixed and the only way to do it is the right way. Unfortunately, that will cost.