On Thu, 1 Dec 2005, Luiz Americo Pereira Camara wrote:

Em Qui, 2005-12-01 às 15:26 +0100, Michael Van Canneyt escreveu:

On Thu, 1 Dec 2005, Joost van der Sluis wrote:


No, it's a FPC problem.

Delphi actually does a dirty trick with the 'NativeFormat' parameter of
GetFieldData. If NativeFormat is false, it does a recursive call of
itself with a temporary buffer, and then converts the data with
an auxiliary method.

This method takes care of the conversion TTimeStamp -> TDateTime
because TDateTimeField sets calls GetFieldData with NativeFormat
set to False.

So we had to fix this in TDataset.
I've done it, it's committed, if someone could please give it a test,
I would be grateful.

This means that a TDataset Descendent always should use the OLD method,
or must override the DataConvert method so it does NOT do the conversion
again in the case of datetime fields.

So we introduce an ugly hack, which no-one understands, only to be
compatible with Delphi? And it's extra overhead.

I'm in accord with Joost.

I agree he has a point, but we cannot go about and patch all TDataset
components on internet. So I would like to see a solution so we can use
all existing TDataset components. And there are a *LOT* of them.


But all TDataset components which I saw use the old method,
so the conversion is needed. We rely on a lot of converted
components.

Besides Zeos what components do it?

Diamond DAO, Modbc, IBX, FIB, TClientdataset, NexusDB, rxmemorydata,
BDE, dbXpress. Those are just the ones I'm using myself.

The ADO datasets are the only ones that use the 'new' format, and they
do a conversion of field dates if the 'NativeFormat' is false.
TDBF has special patches for the 'old' format.

So, out of 10, 9 use the old format. Many components were written in the
pre Delphi-5 days. Borland made sure that these still work.


Anyway, i think that the fpc support to the main databases are good
enough.

Not quite yet.


Then - why should we use TDateTime at all ?!?

I'll take a look at your changes. You are aware of that you probably
broke all non-ZEOS TDataset descendents?

Nono. I fixed sqldb at the same time, of course.

How about sqliteds?

I'm still working on that; I'm using the components for an article,
so you can be sure that. But there were some more problems with
sqliteds. It doesn't recognize VARCHAR fields, for instance.
I also patched the lazsqlite package so it can install sqlite3
support. As soon as everything works to satisfaction, I'll commit the
stuff.

But I'm open for reverting the patch, if we have a solution for all
these datasets out there...

Michael.

Reply via email to