Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[MySQL][ODBC 3.51 Driver][mysqld-5.5.5-10.6.16-MariaDB]You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'AND subcategory_deleted <> 1 AND subcategory_visible = 1 ORDER BY subcategory...' at line 1

/dynamic.asp, line 143