Re: ADO, MySQL, DateTime



Paulo Henrique wrote:

I'm using D6, ADO, TADOQuery, MySQL (5.0.20), ODBC (3.51.12)

One of my tables has a TDateTime field.

When I'm connected to a SQL Server my TDatetime field works fine
but with a connection to MySql the time-part IS STRIPPED from
the data inserted.

Is there a reason for this behavior ?

What can I do to fix it ?

Can anyone give me any clues as to why this is happening?

Thanks,
Paulo



the problem is when Delphi? / ODBC extract the parameters info they set it to adDate to solve this problem you have to set the oleParameter to adDBTimeStamp like this

ADOQuery1.Parameters.ParamByName('aDateTime').ParameterObject.Type_ := adDBTimeStamp;

Yoni.
.



Relevant Pages

  • Re: ADO, MySQL, DateTime
    ... When I'm connected to a SQL Server my TDatetime field works fine ... but with a connection to MySql the time-part IS STRIPPED from ... We used MySQL 4.0 in a project like 3 years ... Contribute to the Indy Docs project: http://docs.indyproject.org ...
    (borland.public.delphi.database.ado)
  • ADO, MySQL, DateTime
    ... When I'm connected to a SQL Server my TDatetime field works fine ... but with a connection to MySql the time-part IS STRIPPED from ...
    (borland.public.delphi.database.ado)