Assuming you know the key is good, this is a common problem.
First,
if you're using EA Downloader (never do that!) change BF2142.exe back to
BF2142PACE.exe like you had it before you started running Mist.
If you never changed the name or you don't use EA Downloader then skip that part.
If this is a fresh install, you may need to download the latest patches, which encrypt your cd key.
If you just changed the key, you may have done it wrong. Search this knowledgebase for "Change Battlefield Key" and follow the instructions there.
Still doesn't work? Try this:
Remove EA Link (if installed) and BF2142. When you re-install, be careful to turn off your security programs (AVG is especially bad). These items may cause a problem. Also be sure that when the game is installed that these programs allow BF2142 and its components to access the internet freely. If behind a router, check to be sure the required ports are open.
After you get the game installed you need to install, in this order,
1. Any add-ons like Special Forces if you have them
2. The latest patch.
Now go to your directory where the game is installed
(ex: C: Program Files - Electronic Arts - Battlefield 2142).
Find the BF2142.exe (or BF2142Pace.exe for EA Downloader Users). Right click and select properties. Next select the tab at the top named compatibility. Under Compatibility Mode uncheck Run this program in compatibility mode for Windows 2000.
Click apply then click ok.
Launch your game and frag on.
Still not working? Oddly enough, now that you've tried compatibility mode, you've set the standard.
Now go back and UNCHECK compatibility mode and try it. It should work.