Quote
CN.ConnectionString = "DRIVER={MySQL ODBC 5.3 ANSI Driver};" & "SERVER=192.168.1.3;" & " DATABASE=test;" & "UID=root;PWD=xxxx;"
Do not connection applications using the root user.
Create a dedicated account for the application to use and grant that account the permissions that the application requires.
Basic principle: The Root account should exist only to give
you, the DBA, the power to clean up the mess made by an Application.
Quote
'RS.Open ...
That first, single-quote, character indicates that the entire line is a
comment and, as such, it is not executed, which is why it gives you no error!
Quote
RS.Open "select * from 08-2018" ...
Avoid "select *" in application code. It's a potential performance-killer.
Avoid special characters in table (and other) names. As you've discovered, they cause problems. :-)
Yes, you can get round the problem by wrapping such names in back-ticks, but it's far, far, easier if you avoid them completely.
Avoid partitioning your data horizontally until you really,
really have to.
MySQL is perfectly capable (with proper indexing) of holding
many years-worth of data in a single table instead of having a separate table for each and every month. The latter design scales poorly, is a maintenance nightmare and can hit all sorts of problems when you decide that you
do need to run a [reporting] query across lots and lots of such tables (is the absolute limit still 61 tables?).
Regards, Phill W.