I found this article to be very enlightening. Many of the "truths" we've believed about affairs aren't true, according to this article.
Here's a small C&P from the end of the article:
Five essential tips to prevent infidelity:
1. Be each other's number one confidant. You shouldn't be sharing private thoughts with others that you're not sharing with your mate.
2. Make time to connect on a regular basis. Daily moments of connection help you build a sense of togetherness and shared purpose.
3. Don't let family time squeeze out just-the-two-of-you time. Relationships that are too child-centered are at high risk for an affair.
4. Recognize when you're temporarily attracted to someone else. It doesn't mean there's something wrong with your relationship -- or that you have to act on it.
5. Surround yourself with people who believe in you and your relationship. If you're ever tempted and don't feel like you can tell your mate, you'll have someone else to confide in who will steer you straight. And if one of you does stray, you'll have a strong support network to help you put your relationship back together.