As others have said, it depends on the country issuing the visa as to whether the validity is retained by an expired/renewed passport.
Timatic, the database used by airlines to check entry requirements, has information about this at least for some countries.
Delta's website has an interface into Timatic:
http://www.delta.com/planning_reserv...tion/index.jsp
For example, there is the following info for US passport holders traveling to Brazil:
ADDITIONAL INFORMATION: a passenger may enter Brazil with a
valid visa in an expired passport provided:
- the page which contains the valid visa in the expired
passport has not been invalidated or mutilated in a manner
as to make the visa illegible.
- the passenger holds also a valid passport of the same
nationality.
- a handwritten annotation does not appear in the passport
that passenger has been advised to obtain a new visa in
valid passport.
IN ALL CASES, TRANSFER OF A VALID VISA TO A VALID PASSPORT
IS HIGHLY RECOMMENDED.