I would have her checked for a urinary tract infection. That's number one...then work on the training which is something I fail miserably at. I opted to get rid of all carpets and went with porcelain tile in my home. Easier.
Seriously, though, you can train an older pup...I know lots of people will give you some ideas. In the meantime, why not get her some doggie panties/diapers? At least your carpet will be saved. Good luck!