OK, let me try explaining this again.
I am skipping through an existing database. It has this structure:
- Code: Select all Expand view RUN
VEHLIC C 12 0 Vehicle license
PMSCOD C 15 0 Labor code
PMSDES C 35 0 Labor description
PMSLSM N 8 0 Last mileage
PMSISM N 8 0 Interval for service in miles
PMSPSM N 8 0 Projected service odometer
PMSLSD D 8 0 Last date of this service
PMSISD N 8 0 Interval for service in days
PMSPSD D 8 0 Projected service date
PMSCLC D Calculated date by average miles
I am skipping through the data base with this process, but only taking the value for PMSCOD to save in an array with other default ( valid ) elements:
- Code: Select all Expand view RUN
DO WHILE TRIM( oPMtable:vehlic) = cVehLic
AADD( aPMitems, { oPMtable:PMSCOD, dBaseD, 0, oPmtable:recno() } )
oPMtable:skip( )
ENDDO
The first value of the array is the code from the record, and the last value is the record number. dBaseD is a valid date, and 0 will be an accumulator.
When I exercise the oPMTable:skip( ), the following code is activated within the most recent database.prg
- Code: Select all Expand view RUN
for n = 1 to Len( ::aBuffer )
::aBuffer[ n ] = ( ::cAlias )->( FieldGet( n ) )
next
In other words, after the skip(), a load() is issued for the contents of the record. IF n has corrupted data ( in the database itself ), it is in one of the 3 date fields in the structure. FWH then returns the error:
Error description: Error ADSCDX/5095 Error 5095: The date specified is not valid. Date won't convert to julian. when trying to load the contents of the record into the buffer.
It is called from:
Called from: => FIELDGET( 0 )
Called from: C:\Projects\MLS2015\Source\database.prg => TPMSTABLE:LOAD( 1048 )
The error occurs on a READ ( GET ), not a Write. Of course with the generated error, the program aborts. When I look at the database using Advantage Data Architect, the field may show the word [contaminated], or it might appear blank. If I look at it with a dbu utility, it just shows the field as blank. However something is apparently imbedded in there.
So somehow I need to trap the record itself before it loads, test it, and perhaps overwrite the value with one that is legitimate.
Hopefully this utility will only have to handle this task once and we won't see the errors in the future, but for now I'm looking for a solution. As I say, the error occurs in Database.prg when loading values into a buffer.