Read Field Value AsDateTime

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
FarshadV
Posts: 22
Joined: Sat 31 Jan 2009 21:55

Read Field Value AsDateTime

Post by FarshadV » Tue 06 Apr 2010 23:01

I am connecting to a SQLite3 database with the UniDAC components (ver 3.00.0.7), and when I try to retrieve a column's data which contains Date and Time value I get an error.

My code is:

Code: Select all

TmpDate:= dmECOE.qryGeneral.FieldByName('OrderDate').AsDateTime;
The generated error is:
EConvertError "2010-03-26 00:00:00" is not a valid date and time.
Your help is very much appriciated.

Regards,

Farshad R. Vossoughi

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Wed 07 Apr 2010 13:39

It seems like the "OrderDate" field does not have the DateTime type in the database. If the "OrderDate" field has string type in the database then you should get this field as FieldByName('OrderDate').AsString and convert to the TDateTime format manually.

FarshadV
Posts: 22
Joined: Sat 31 Jan 2009 21:55

Post by FarshadV » Fri 09 Apr 2010 13:29

Thank you very much

Best Regards,

Farshad R.Vossoughi

Post Reply