Buying property above commercial real estate is quite a gamble, especially if its zoned in a place that allows for late night noise from such. Unless the bar is violating a specific ordinance, this is probably an unwinnable situation...if you own, you could always rent the property to some young folks who dont mind the noise,and use the income to rent a place out in the country.
Source: ran bars with unhappy tenants above,and won the suits.