Bereishis Rabah (34:10) says that a Tzadik speaks El Libo, and a Rasha speaks b'Libo. Koheles said b' Libo (here, and below 15, 3:17-18), and also Avraham did (Bereishis 17:17)!
Ma'ase Hashem (Ma'asei Avos 21, Yayera): The Midrash expounds based on the majority, even though there are exceptions.
Ha'Emek Davar (Bereishis 17:17): This rule applies only when the person's name is mentioned.
Shlomo wrote Koheles at the end of his life, after his wives veered his heart. Just like a verse (Melachim I, 11:7) attributes to him as if he built a Bamah to idolatry, so here it says b'Libo, as if he were a Rasha 1 . (PF)
This cannot answer for Avraham! Chizkuni (Bereishis 17:17) - the rule does not apply to Avraham, for he was astounded in his heart.
Why did he say "Lecha Na"?
Metzudas Tziyon: It was to invigorate himself, like "v'Atah Lechu v'Nahargehu" (Bereishis 37:20); Yosef was coming to them. "Na" means now.
Why did he decide to try Simchah?
Rashi: Since much Chachmah adds anger, I will cease Chachmah, and engage in Simchah.
Ri Kara: Since I will leave my wealth to others, I should enjoy what I toiled for!
Rid: Because all worldly matters are Hevel.
What is the meaning of "Anasecha v'Simchah"?
Rav Sadya Gaon: I will enter Simchah in my heart, and it will attain good and happiness.
Rashi: It is an expression of Masach (mixing) wine, like "Maschah Yeinah" (Mishlei 9:2) - mixing wine with water to fix it 1 , or mixing it with spices to make spiced wine.
Ibn Ezra, Rid, Targum: Anasecha is like Anaseh Osecha, from the root Nasah (to try). Ibn Ezra - we find like this "Achavecha Shma Li" (Iyov 15:7), "Achanecha v'Lo Yedatani" (Yeshayah 45:5).
Rashbam: Anasecha is an expression of Nesichos and Katzinus (royalty, authority). I will conduct with authority of Simchah, to hear Sarim v'Saros 2 , so I will be happy.
Seforno: I will conduct my kingship and Nesichos (authority) with Simchah of pleasures.
Metzudas David: I will do a Nisayon (experiment), to engage in Simchah and seeing nice things that are pleasant to the eye and rejoice the heart. Perhaps this is the correct path!
What is the meaning of "u'Re'eh v'Tov"?
Rashi: This is like u'Re'os b'Tov. (To see good; it is not a command.)
Rashbam: To have laughter and joy.
Seforno: I will despise spiritual good and attaining eternity, and consider it withheld [from me].
Metzudas Tziyon: It is seeing nice things that are pleasant to the eye and rejoice the heart.
Why is this Hevel?
Rashi: I saw via Nevu'ah great ruin that comes from laughter. Belshatzar died amidst a Mishteh, and Dor ha'Mabul was flooded amidst great good that You bestowed on them.
Rashbam: I do not get any gain from laughter and joy.
Ri Kara: Refer to 2:2:5:2.