This thread again.
First of all, the most determining factor in sound quality is how the music was recorded, mastered, and mixed. To quote Audioholics:
"How the recording was made often plays a more dominant role in sound quality over the comparative differences of the formats."
After that, it's the quality of your speakers, and even more importantly, how they are placed in your room and interact with your room's acoustics. A properly placed set of 500.00 Klipches will sound worlds better than a 5K set of poorly placed Paradigm References in a bad room.
Then next, is your amp. Hook up a set of KEF Monitors to a shitty Lepai Tripath, and it's going to sound like shit at anything over 70-75db, regardless of the quality of the speakers or the "format." To prevent clipping and distortion, you want to make sure you're using an amp with plenty of overhead.
Cables are next. And no, I'm not talking about bullshit, cryogenically frozen cables soaked in dragon's blood. But gauge is important, and to insure optimal signal flow from your amp to your speakers, you want something with low impedance. 10-16 gauge wire will do in most cases. Lower the gauge the better, usually.
Next is playback equipment. CD players are only as good as their DACs, so an early CD player from the era when DACs still weren't "solved," probably won't sound as good as a modern 20.00 DVD player from Walmart or your soundcard's DAC. And of course, if your turntable has a worn needle or poor build quality, it'll introduce artifacts.
Now we get to "format," and the differences between a well mastered/mixed vinyl recording and a well mastered/mixed digital record is so miniscule, it's not really worth debating.
They both have very subtle, yet audible, differences that might work for one genre better than another (per your tastes), but you "can't go wrong" with either.