In chapter 2, Solomon launches into what he had learned about his works of building material things like houses and gardens and seeking even greater wealth. His conclusion? All of these material achievements were nothing but vanity, a grasping after wind.
He finds no real, sustained profit in them, nothing that truly added to his quality of life, no lasting fulfillment. He does not mean they resulted in no sense of achievement or passing pleasure, but that their fruit never truly fulfilled God's purpose for man. Therefore, those things are poor substitutes for a sustained sense of well-being. He then proceeds into an exploration of wine and entertainment. These are simply another form of materialism, ways of pleasing the flesh. He concludes that they, too, are folly, a mad pursuit.
John W. Ritenbaugh
Ecclesiastes and Christian Living (Part Seven): Contentment