Commentaries
7:23-29 Solomon, in his search into the nature and reason of things, had been miserably deluded. But he here speaks with godly sorrow. He alone who constantly aims to please God, can expect to escape; the careless sinner probably will fall to rise no more. He now discovered more than ever the evil of the great sin of which he had been guilty, the loving many strange women,
23. All this—resuming the "all" in Ec 7:15; Ec 7:15-22 is therefore the fruit of his dearly bought experience in the days of his "vanity."
I will be wise—I tried to "be wise," independently of God. But true wisdom was then "far from him," in spite of his human wisdom, which he retained by God's gift. So "over wise" (Ec 7:16).