[Openroad-users] Dates in Openroad/Ingres
Stijn Caroen
Stijn.Caroen at ap2.be
Thu Feb 8 00:46:24 EST 2007
Hello,
We have a recurring problem with a client where users need to enter date
values in an Openroad application. For instance, they will enter a date
value "01/04/0206" instead of "01/04/2006". These mistakes will
generate errors in some batchs that run during the night. Some tests
have shown that:
- If you enter such a date in Ingres version Ingres II 2.0 via
the terminal monitor (sql command)
o Error message: not a valid year
o Same error message if you use for instance 01/04/206
- If you enter such a date in Ingres version R3 or 2006 via the
terminal monitor (sql command)
o No error message, the data is saved
- If you enter a date in a date field in Openroad and you save
your data
o Using a database with version Ingres II 2.0 or Ingres R3 or
Ingres 2006
* No error message, the data is saved
I have several options I can already use:
* I could add a rule on every date attribute in the database that
will not allow saving this kind of data but I don't like this
solution...
* Create your own check in Openroad for date type validation,
discussed in the sections below
Openroad provides us the possibility to change the procedure that is
used when a value given by a user does not correspond to the type of the
field. For exemple, a user that enters a string in an integer field
will generate a type definition error. This error can be handled by
your own procedure (bypassing the error message given by Openroad =
override DataEntryErrorHandler of the frame).
The exported application in attachment (OR 2006) contains a user frame
where I use my own type violation procedure (DataEntryErrorHandler). As
an extra, I added an event to the frame that can call a generic
procedure that sees to it that there is no date entered by the user that
is lower than '01/01/1900'. If you launch the frame, you will see that
is not possible to perform any actions on other fields when you have
entered a wrong date in the first entryfield.
Using this option, I would need to add the event into every frame that
uses date fields (which would all call the same procedure for type
checking).
My question: is it possible in Openroad to extend the type validation
procedure used by the Openroad runtime? For instance, if you enter a
date that is lower than '01/01/1900', the validation does not pass and
Openroad shows an error message (or your own procedure is called for
handling type validation errors).
What I mean is, that at the entry point of the application, you can add
one call that allows to add extra checks for type validation that will
be active for the whole application session. This can bypass the need
to add extra code at each frame like in the option discussed above (the
code is not generated with this particular client and there are quite a
number of frames).
Or does anyone have another idea?
Cheers,
Stijn Caroen
AP&P, Belgium
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://peerlessit.com/pipermail/openroad-users/attachments/20070207/9b250cf7/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestDateValid.exp
Type: application/octet-stream
Size: 55991 bytes
Desc: TestDateValid.exp
Url : http://peerlessit.com/pipermail/openroad-users/attachments/20070207/9b250cf7/attachment.obj
More information about the Openroad-users
mailing list