I understand what you are going through. Our pup was diagnosed with a UTI when she was about 3 months old (she's now 11 months) and was still in the process of being potty trained. She was drinking a lot of water and would just trickle a tiny amount of urine when she went potty... and went VERY frequently.
Charly was put on antibiotics for 2 weeks. After that, she was tested again and the UTI did not appear to be completely gone. So the vet put her on the same medicine for 2 more weeks. At the end of this perscription, she was tested again and the doc gave her a clean bill of health- even though I told him her symtoms still seemed to be persisting.
She continued to have accidents all the time even though she obviously knew how to ask to go out. She was bell trained. However, she'd ring the bell and then only be able to wait 2 seconds before she peed on the floor. Needless to say.. this was very frustrating. On top of all this, she couldn't make it through the night without having to go outside at least once. My boyfriend and I were so sleep deprived and frustrated. I contacted the vet and he assured me that she was "acting like a puppy" and was "being stubborn". This went on for several months and finally I couldn't handle it any more and took her to another vet.
This new vet tested her and the results didn't absolutely indicate that she had an UTI but because of her behaviour, they put her on a different, stonger antibiotic. There are 2 different typed of bacteria that can cause a UTI and typically the vet just treats for the more common one. But this vet felt that it could certainly be the same UTI Charly had had months earlier but never cleared up because the antibiotic she was originally given was not the correct type for the bacteria causing the infection <did that make sense?>.
After a two week regiment of this new different medicine... Charly was fianally able to "hold it" for hours and hours! Remarkably, she's not had an accident since!
Sorry about the long story-- but just wanted you to know that you're not the only one going through this. House training is a frustrating process, but possible. House training a pup with an UTI is frustrating and IMPOSSIBLE. It was a very trying time for us.. but once it cleared up... things were great. Just be very consistant with the positive reinforcement and "watch" your pup all the time. Charly was clearly house trained already but just couldn't hold it due to the infection. Once the the UTI was sucessfully treated... she knew just what to do.
Hope this helps.