Theoretically, a police officer needs to have probable cause to insist on searching your vehicle. You must verbally consent to a search otherwise.
Probable cause includes, but is not limited to, the driver acting nervously (at the discretion of the officer)*, the smell of marijuana or alcohol on the breath of the driver or coming from the car (at the discretion of the officer), or something as simple as not wearing your safety belt, or a busted license-plate light, such as, the one I once was ticketed for in SA. Practically, any serious moving violation.
If you refuse consent and you have not broken a serious (Class 1?) traffic infraction, the officer has no probable cause to search your vehicle. However, if the officer feels that there is probable cause to hold you, and you still refuse to consent, he can call for a drug-bomb dog to sniff the exterior of your vehicle and if the dog smells anything this immediately gives the police probable cause to search your vehicle without consent.
* (anyone remember this is how Tim McVey got busted?)