I know for a fact a knock sensor code won't disable VTEC. An IAT code won't disable VTEC. Both just cause the ECU to retard timing to keep any problems from happening.
I'm pretty sure that an O2 sensor code won't disable VTEC, because I seem to remember my O2 sensor going out, and I ran like that for a few days before I replaced the sensor. Once again, it just causes you to lose some power from the ECU being careful.
However, back to the original question: The ECU has to be throwing some other code if VTEC isn't working. Are you sure it isn't throwing multiple codes?