List:MySQL ODBC« Previous MessageNext Message »
From:Michael Widenius Date:October 20 1999 5:13pm
Subject:Problem updating/inserting DATETIME data
View as plain text  
>>>>> "Gary" == Gary Wong <gary.wong@stripped> writes:

Gary> Hi All,
Gary> I am using ASP->myODBC->mySQL.

Gary> Normally, I do all my update/inserting by creating the SQL statement
Gary> and sending it to myODBC and all is fine.  However, I am modifying
Gary> a third party ASP script that likes to use the 
Gary>  1) "open recordset",
Gary>  2) "recordset.fields = 'newdata'"
Gary>  3) "recordset.update"
Gary>  4) "recordset.close"

Gary> methods.  The problem I have is that when I tried to update a DATETIME
Gary> field, I get and error like this:

Gary> [TCX][MyODBC]You have an error in your SQL syntax near
Gary> ',EndDate=1999-10-10 00:00:00 WHERE (AdID=2723 AND ' at line 1 

Gary> It seems that the MyODBC isn't putting single quotes around the dates.  
Gary> Anyone else see this problem?  Is it a bug?

Hi!

To be able to help you we would need to know a lot more information about
what exactly happens between MySQL and MyODBC!

You can try to do a MyODBC trace file:

Bring up the MyODBC connect dialog, either from your program or using
the ODBC administrator, and set the option marked: 'Trace MyODBC'.
This will tell MyODBC to make a trace file in C:\myodbc.log that
contains lot of information that will help you (and us) to debug the problem.

Check the queries that MyODBC sends to the MySQL server;  You should be able
to find this by searching after ">mysql_real_query".
Try duplicating the queries in the MySQL monitor to find out if the error is
MyODBC or MySQL.

If you find out something is wrong, please only send the relevant rows (max 40 rows) to
the myodbc@stripped;  Not the whole MyODBC trace file !

If you are unable to find out whats wrong, the last option is to make a MyODBC
trace file + a standard ODBC SQL log file and send both of these,
together with a README file that explains the problem, to:

ftp://www.mysql.com/pub/mysql/secret

(Only we at TCX will have access to the files you upload and we will be very
discrete with the data!)

If you can create a program that also shows this problem, please
upload this too!

If the program works with some other SQL server, you should make a SQL LOG
file where you do exactly the same thing in the other SQL server.

Remember that the more information you can supply to us, the more
likely it is that we can fix the problem!

Regards,
Monty
Thread
Problem updating/inserting DATETIME dataGary Wong20 Oct
  • Re: Problem updating/inserting DATETIME dataHendrik M.J. Arnoldus20 Oct
  • Re: Problem updating/inserting DATETIME dataGary Wong20 Oct
    • Re: Problem updating/inserting DATETIME dataMichael Widenius20 Oct
  • Problem updating/inserting DATETIME dataMichael Widenius20 Oct
  • Re: Problem updating/inserting DATETIME dataGary Wong21 Oct
    • Re: Problem updating/inserting DATETIME dataMichael Widenius21 Oct
  • Re: Problem updating/inserting DATETIME dataHendrik M.J. Arnoldus21 Oct
  • Re: Problem updating/inserting DATETIME dataGary Wong21 Oct
  • Re: Problem updating/inserting DATETIME dataGary Wong25 Oct
Re: Problem updating/inserting DATETIME dataMichael Widenius23 Oct