Oops! I had similar experience.
My car passed the smogcheck when its check engine light was on in 2006. But there was a mark on my certificate, something like "check eng light on".
A lot of factors can cause the check engine light on. It doesn't have to be related to the emission system. My car had a bad cooling senser at that time. Hope this can help.