Ford Explore it pass smog but the comput has not deleted code show it failed smog?

I tried erasing code but to no avail it won't pass smog. It won't pass smog until I can erase the codes please help

#1.To erase the codes you pull the battery from the car. But after that if the codes pop up again then the computer is still reading that there's a problem and you will have to get it fixed.

#2. When the code is cleared you must drive the vehicle 100-200 miles before you can get a smog check. The reason why is because when they hook up their computer it will say there's no memory on your cars computer and make it an automatic fail.

#3. Most people say to drive it 200 miles because the computer should pop up with a service light/check engine light by then.