Bug when using MySQL from ASP
Wednesday, April 16th, 2008I have recently been upgrading a site written in classic ASP to use MySQL instead of SQL Server - a relatively straightforward task given the availability of an ODBC driver for MySQL. Testing on our development server, the new code worked perfectly.
Once uploaded to our hosting server, however, the site no longer worked correctly. More specifically, the page that was supposed to ‘list all properties’ was reporting that there were no properties in the database. This was definitely not the case! The connection string and code were identical on our development server and the hosting server.
A little debugging showed that the ODBC driver was actually returning an empty result set (0 rows) on a particular query. Some digging through Google showed that this is a known bug in old version of the MySQL ODBC driver.
It turns out, however, that older version of this driver have an annoying bug that causes some (valid) queries to fail silently and return an empty result set.
Dan.
