The covenant of works is essentially - "obey and live; disobey and die".
The covenant of works was made with Adam in the garden and continues to this day. After Adam violated the terms of the covenant of works God graciously made a second covenant with Adam - the covenant of grace. Every person on the planet, being a descendant of Adam, is either in the covenant of works or the covenant of grace.
This is to say, all of us are either depending upon our own works and are thus in a violated covenant relationship with God; or we are depending on the works of Jesus Christ and thus are in a fulfilled covenant relationship with God. Jesus, being a descendant of Adam, was born under the covenant of works and he took the curse of that covenant and also fulfilled its terms of obedience.
Romans 2:6-7 says that it is indeed possible to be saved by works (in theory). The problem is that no one will be saved by works because we're all sinners.