1

I have a date field stored just fine in MySQL:

enter image description here

But when I try to connect to it using the Microsoft ODBC driver, I get the following error:

ERROR [HY000] [MySQL][ODBC 5.3(a) Driver][mysqld-5.7.19-log]Incorrect date value: '3/22/2013 12:00:00 AM' for column 'newdate' at row 1

This seems to be an issue with the ODBC driver. I'm using MySQL ODBC 5.3 ANSI Driver.

Anyone else encountered this error?

Update: Here is the c# code that generates this error:

DbCommand command = DbProviderFactories.GetFactory("System.Data.Odbc").CreateCommand();
command.CommandText = "CREATE TEMPORARY TABLE _newTable AS SELECT * FROM `"  
    + tableName +"`";
command.Connection = TheDB.TheConn;
command.ExecuteNonQuery();
dashnick
  • 2,020
  • 19
  • 34
  • WHEN is this error occuring? BY selecting, updating or inserting data? From other ODBC-Driver I know there are some options in the ODBC administrator configuring the connection, perhaps that helps. – Myonara Aug 04 '17 at 14:02
  • This happens when trying to execute a `DbConnection` `CREATE TABLE ` command... – dashnick Aug 04 '17 at 14:17
  • Please post the CREATE TABLE command, which you are sending via ODBC? – Myonara Aug 04 '17 at 14:19

0 Answers0