Page 1 of 1

Datetime fields with TSQLTimestampField

Posted: Sat 22 Jan 2011 19:57
by luciofialho
When I first implemented my program, the TSQLDataset mapped Datetime fields in TSQLTimeStampField.
This is true, for example for a query as simple as “select getdate() as GD”: the GD is created as TSQLTimeStampField, doesn’t matter if in design and runtime.

Now I am converting this program to work with SDAC and every datetime field give me a message like “invalid data type for field ‘GD’, expected SQLTimeStamp, used: DateTime”.

I cannot convert all TSQLTimeStampField definitions in code it is a requirement that the application still working with DBExpress (with Devart driver), so we choose which query component will be instantiated based in a configuration parameter.

So, here is my question:
Is there a way to make TSQLTimeStampField work with datetime fields in TMSQuery, just like it does in TSQLDataset?

Thanks in advance.

Posted: Wed 26 Jan 2011 09:36
by AndreyZ
Hello,

dbExpress doesn't support TDateTimeField and that's why it maps datetime fields to TSQLTimeStampField. You cannot map datetime fields to TSQLTimeStampField using SDAC. If you want to use SDAC and DbxSda at the same time, the only solution is to create persistent fields dynamically.