Ecclesiastes is like an autobiography of King Solomon. He had it all. Solomon was the richest and wisest man on earth. But, he was not fulfilled until he sought after things of God.
We can be rich and wise, but if we are not using it to glorify God, we will find no fulfillment.
Ecclesiastes 1 (KJV)
1 The words of the Preacher, the son of David, king in Jerusalem.
2 Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
3 What profit hath a man of all his labour which he taketh under the sun?
4 One generation passeth away, and another generation cometh: but the earth abideth for ever.
5 The sun also ariseth, and the sun goeth down, and hasteth to his place where he arose.
6 The wind goeth toward the south, and turneth about unto the north; it whirleth about continually, and the wind returneth again according to his circuits.
7 All the rivers run into the sea; yet the sea is not full; unto the place from whence the rivers come, thither they return again.
8 All things are full of labour; man cannot utter it: the eye is not satisfied with seeing, nor the ear filled with hearing.
9 The thing that hath been, it is that which shall be; and that which is done is that which shall be done: and there is no new thing under the sun.
10 Is there any thing whereof it may be said, See, this is new? it hath been already of old time, which was before us.
11 There is no remembrance of former things; neither shall there be any remembrance of things that are to come with those that shall come after.
12 I the Preacher was king over Israel in Jerusalem.
13 And I gave my heart to seek and search out by wisdom concerning all things that are done under heaven: this sore travail hath God given to the sons of man to be exercised therewith.
14 I have seen all the works that are done under the sun; and, behold, all is vanity and vexation of spirit.
15 That which is crooked cannot be made straight: and that which is wanting cannot be numbered.
16 I communed with mine own heart, saying, Lo, I am come to great estate, and have gotten more wisdom than all they that have been before me in Jerusalem: yea, my heart had great experience of wisdom and knowledge.
17 And I gave my heart to know wisdom, and to know madness and folly: I perceived that this also is vexation of spirit.
18 For in much wisdom is much grief: and he that increaseth knowledge increaseth sorrow.