Generally, I find it's best not to ask a girl this sort of question until you've had sex with her. As GeneralFap correctly noted, it makes her subconsciously aware of the fact that the word "virgin" holds some value to you, otherwise you wouldn't have asked about it. This can easily result in LMR during escalation toward sex.
That being said, once you've already been in the sheets with her, asking her about what her virginity status was (prior to sex with you) is usually a non-issue. You can bring it up in post-sex "pillow" talk with her or maybe the next time you see her (if you choose to see her again).
EDIT: As a side note, I'd like to mention that Hector's method is interesting in the sense that, it probably is a good thing if the girl actually IS a virgin -- it lets him address the topic with her so that she feels comfortable with it, and then he can get more sexual with her without worrying about reservations on her end. At the same time, it's a bit of a double-edged sword; if the girl is not a virgin, then you've suddenly put pressure on her to act that way by letting her know that you value the word itself. This is what can result in the LMR.
So, if you're strictly screening for virgins, it might not be a bad idea to ask girls about it prior to sex (since screening out a "non-virgin" actually helps your cause). But if you're trying to cast a wider net and lay both virgins and non-virgins, it might be better to play it safe.
- Franco