> > > 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, and as TDateTime in the Fields unit. The conversion is done in the DataConvert-method. 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... Or, as I said: make a simple protected property and do the conversion if that property is true or false. Since there can only be two versions of DataConvert: the one that does the conversion (default) and the one that doesn't. (all fpc-datasets have then to override) btw: in your solution the overloaded TField.GetDate without Nativeformat is useless and only extra overhead since we can't inline it. So it should be removed if nothing is changed further. (btw: since your fix Zeos doesn't work anymore at all. See the mails in this ML about this: it works with 2.0.2 and doesn't with 2.0.3. I think the reason is that you call GetDate with False for variants. But I don't have Zeos installed so can't test that.) -- Met vriendelijke groeten, Joost van der Sluis CNOC Informatiesystemen en Netwerken http://www.cnoc.nl _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
