[fpc-devel] Fixed date/time formats for sqldb and tdbf?

Joost van der Sluis joost at cnoc.nl
Thu Aug 11 13:31:49 CEST 2005


On Thu, 2005-08-11 at 13:16 +0300, Alexandrov Alexandru wrote:
> On 8/11/05, Joost van der Sluis <joost at cnoc.nl> wrote:
> > > In revision 803 log: Fixed date/time formats for sqldb and tdbf
> > > I don't understand what is fixed.
> > > Beside that, the compatibility with databases that use TDateTimeRec is broken.
> > > They used this format before D4 and they still use now for
> > > compatibility. D7 can handle this format. FPC no more, since this
> > > revision.
> > > IMO there is nothing fixed there, but broken.
> > 
> > Well, as it was, id didn't work for any database which uses TDateTime,
> > which are all fpc-databases and all Delphi databases written for D4+.
> > 
> > Personally I don't know any TDatabase descendents that can't work with
> > TDateTime. Can you give me one? Then I can look for a solution.
> > 
> > Regards,
> >  Joost.
> > 
> 
> I was sent the patch that fixed this compatibility (and i explained that).
> I agree that we can remove the old code when are no more compatible
> with the rest of code, but this piece of code do not harm anyone.

With your patch tDbf, UIB, Zeos, SQLDB, PQSQL and many others didn't
work anymore.

We have to find a clean way to 'detect' if the TDataset descendant
expects a TDatetime or a TDateTimeRec. I have no clue how Delphi does
this (I even doubt that it can, but you said that it does), but I know
it has nothing to do with the NativeFormat property. Maybe the Datasize
of a field, but that's a TField property and is always Sizeof
(TDateTime). 

> I can't send the component to you because it is not free, but after
> registration you may find it here:
> http://devzone.advantagedatabase.com/as/advantage_solutions.dll
> After one hour spent for conversion, this components works great. 

The problem could easily be resolved around line 5103 of adsdata.pas.
(you only need a few conversions, you know everything about those)

It's suprising to see that if you use parameters with that database, it
does use TDateTime, with a ifdef for delphi versions below D4. But for
GetDataFiels it still uses a TDateTimeRec.


Joost.







More information about the fpc-devel mailing list