@R**
, Surprisingly the immigration office and the thai consulate are run by completely different gov't agencies.
One is a division of the Royal Thai Police and they handing visas/extensions INSIDE the country.
The other is run by the Ministry of Foreign Affairs and they sell visas OUTSIDE the country.
I also know exactly what an immigration office sees on the computer screens when you do a 90 day report, when you file for a yearly extension of stay and when you stamp into the country
Before 2006 there was NO central data base which showed entries/exits into the country anywhere except the airports (that started in 2005),
BUT
now all the entry points are tied together. Changing passports might work to get a tourist visa from a thai consulate. However, when you stamp in, even on a new passport, your entry data from the old passport comes up on the screen.