On Mon, 12 Dec 2005, Joost van der Sluis wrote:
As TDbf author my interpretation of NativeFormat is: True means data
passed to/from Get/SetFieldData is in Delphi 5+ internal format
(TDateTime and friends), False means data is in Delphi 4- internal format
(TDateTimeRec and friends).
That is also my understanding of this field. The name is chosen rather
unfortunately. The point is that it's also used by Borland for OLE Fields,
some Byte Array fields etc.
It's also in this sense that I applied the patch. I will not revert it,
there are simply too much TDatasets out there that should be supported.
But I'm willing to fix sqldb, as I was the one that broke it.
I can fix sqldb, but to do that I have to understand how it works now,
which I don't.
With your implementation, the solution is simple: let TField always call
GetFieldData(buf,True); Then it will allways get the D5+ style.
But how can TField know that the D5+ style is supported by the TDataset?
It can't. So the whole option is useless again?!?
Ok, now you made it so that FieldData(buf,true) is called if the field
is a Date/time field or a variant. And FieldData(buf,false) for all
other fields.
What is the gain of that? In FieldData(x,x) you do a case on the
fieldtype to take action when it's a date/time field.
Then assign memory for a temporary buffer, convert and free the memory.
(What do you mean, no overhead?!?)
What you do is the following: Date/Time fields are handled as
TDateTimeRec in TDataset,
No they are not ? This is the whole point of NativeFormat.
The nativeformat determines whether the buffer contains a TDateTime
(True) or a TDateTimeRec (False). By default, FPC has True.
and as TDateTime in the Fields unit. The
conversion is done in the DataConvert-method.
The conversion is indeed done in DataConvert, but as I see it,
for SQLDB there should be no conversion ?
If you make that descision, thus using TDateTimeRec internally by
default and overriding the Dataconvert function if it's not. Then do
just that. And don't put in the NativeFormat parameter.
And instead of overriding DataConvert, overriding GetFieldData would be
much more efficient...
No problem.
Make an implementation that keeps Zeos and SqlDB working.
I obviously have problems understanding what you mean, so maybe
it's easier if you show me some code :/
Michael.
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives