On 16 May 2006 13:23:57 -0700, "Utah Jeff" <jfullmer@[EMAIL PROTECTED]
> wrote:
>I have a client that is running a program written in D5 and using BDE
>5.01 running on XP home. We do not have access to the source code.
>There are only 2 digits available for the birth year. When they enter
>41 for 1941 the system stores it as 2041. I looked at the BDE Init
>settings and tried all combinations of FOURDIGITYEAR and YEARBIASED.
>I keep seeing references to changing a Windows date format. Is there a
>fix for this problem since we do not have the source code? Where is
>the Windows date format setting they are talking about?
Here is some more background info which might help:
from the Delphi Help file
TwoDigitYearCenturyWindow Determines what century is added to
two-digit years when string dates are converted to numeric dates with
StrToDate or StrToDateTime The value of TwoDigitYearCenturyWindow, if
it is nonzero, is subtracted from the current year to calculate the
floating “pivot” prior to which two-digit years are interpreted as
falling in the next century. The default value is 50. You can use
TwoDigitYearCenturyWindow to extend the life of legacy applications
that are tied to two-digit-year data entry; but the best solution is
to require four-digit input for years.
As I understand it, this is a variable internal to your Delphi app.
Other formatting vars are stored in the Windows registry where you can
set them outside of the app. If your app uses the StrToDate or
DateTime routines, [which it almost certainly does for date entry],
the app will send a four digit year to the BDE, or an integer date
code with the year already set. This is probably why you have not been
able to make any difference with BDE settings.
The only workaround that comes to mind is to have the users always
enter the year as four digits. Depending on how the date entry
controls were set up by the programmer, they might take a four digit
year. My programs all will allow the user to enter a two or four digit
year, and the full four digit entry overrides the century window
setting. [BTW, the value of the 'pivot' year can by made settable by
the user if this makes good sense in an individual application.]
HTH,
Dan


|