Veggies that are frozen or canned are almost just as good as fresh, and is safer cause veggies being cooked gets rid of bacteria, like ecoli for example, which is unlikely but can happen. I eat cooked veggies also, except for salads and my "very veggie" juice. From what I learned, cooked veggies are the way to go, according to my microbiology teacher.
I have read that sometimes frozen veggies actually have more nutritional value because they are usually frozen near the fields where they are grown. On the other hand, depending how they are handled during shipment, fresh veggies can travel long distance and be exposed to light which diminishes nutritional value. Canned I would skip because they are usually overcooked (IMHO) I would imagine either from cooking too long or at too high a temperature, which would kill off nutrients.
Being one with GI track issues, I have found it essential to eat some raw veggies and fruits. I strive towards increasing the amount I eat. The only contamination I have read about was either from juices; sprouts and salad bars. I have never heard of anyone getting an infection from buying whole veggies and fruits at the store or sprouting their own sprouts.
I have read from many reliable sources that frozen veggies are just as good as fresh. Try to stay away from the canned veggies, they have entirely too much sodium, and I agree with the previous poster, they are always way overcooked. Any time you can keep the veggies as close to fresh as possible, will be better tasting and better for you.
My vote is for fresh and frozen, but avoid canned at all costs. Also, avoid the frozen varieties that are prepared with sauces... stick to the higher quality plain veggies.
I gave also noticed a dramatic difference between brands. Green Giant frozen seems much fresher and higher quality than Birdseye, for example. I also won't use the store-brand frozen - I usually find freezer burn and discoloration... yuk.