I went through something very similar when I first got Emily. It took alot of time and patience, but she hasn't had an "accident" in quite awhile. I even managed to introduce a second cat into the household without problems. I am including a link to a website that can offer many suggestions to help your cat.

http://www.geocities.com/Heartland/P...1/houstrng.htm

Before giving him away you might want to try medication (e.g. kitty prozac). For many cats that can't be re-trained this is a viable option. Although you first option should be to attempt to re-train him.

Good luck