Datetime fields with TSQLTimestampField

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 1
Joined: Sat 22 Jan 2011 19:38

Datetime fields with TSQLTimestampField

Post by luciofialho » Sat 22 Jan 2011 19:57

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.


Post by AndreyZ » Wed 26 Jan 2011 09:36


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.

Post Reply