Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2005-08

Fixed date/time formats for sqldb and tdbf?

4 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexandrov Alexandru

Hi

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.

Alex

Reply by email

Joost van der Sluis
to Alexandrov Alexandru
Show quoted text 7 lines
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.

Reply by email

Alexandrov Alexandru
to Joost van der Sluis
Joost van der Sluis wrote 17 lines
> 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. 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.

Alex

Reply by email

Joost van der Sluis
to Alexandrov Alexandru
Alexandrov Alexandru wrote 22 lines
On 8/11/05, Joost van der Sluis 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.

Reply by email