On Thu, 22 Apr 2010, snaipe...@users.sourceforge.net wrote:

Hi,

> 2010-04-22 18:45 UTC+0300 Mindaugas Kavaliauskas (dbtopas/at/dbtopas.lt)
>   * harbour/contrib/rddads/ads1.c
>     ! Fixed date handling in area putValue method for .dbf tables. 
>       ADS does not support dates smaller than 0001-01-01 and stores 
>       invalid values in .dbf without any error. F.e., 0000-01-01 is 
>       stored as '-0011231', CTOD("")+5 is stored as '****1128'. Such 
>       invalid filed values generates ADS runtime error 5095 later on 
>       getValue area method.
>       DBF RDD stores empty dates in case of unsupported date range.
>       This fix makes ADS RDD behaviour more compatible to DBF RDD. 
>       ADSADT behaviour is not changed because ADS allows to store 
>       and retrieve field values for dates before 0001-01-01.

ADS should support in DBF (at least in VFP mode) julian date fields
as 32bit little endian integer values {"D", 4, 0} which do not use
string representation.
As I can see your modification effected also such fields.
I think that you should change the condition from:

   pArea->iFileType != ADS_ADT

to:
   pField->uiLen == 8

or
   pField->uiLen != 4

(AFAIR uiLen == 3 in ADS DBFs is SIX3 packed date with the same
restrictions as string version)

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to