Subject RE: [IBO] Different date/time formats and parametrized queries
Author Thomas Steinmaurer
Hello Jason,

> I think you will need to write a custom routine to handle this requirement.
> You might check some of the free Delphi component sites for libraries that
> have date processing routines.
> That's an interesting idea to incorporate this into the getter of the AsDate
> getter method. I'm open to suggestions on how this logic could be hooked in
> and made use of for your flexibility.

I can be sure that the DATE stored as VARCHAR is a valid IB/FB
date (it is stored via a trigger by an implicit DATE to VARCHAR
conversion), so I guess it should work, if I simply assign the
string to the parameter of a prepared query, but only, if the
date/time "checking rules" are disabled.

For example. I have the following DML query.

UPDATE "test table" SET ADATE=:ADATE WHERE ("id"='9467')

After preparing the query, I have one parameter ADATE with
TIB_Column.IsDateTime=true, so the parameter is recognized
to work on an underlaying date/time field.

If I try to assign the ADATE parameter the value '1-JAN-2003'
via the .AsString method, then I get a '... is not a valid
date and time' error message, so it seems there is a date/time
check which uses some local Windows regional settings, even
when the .AsString method is used.

Is there a way to suppress these date/time checks, or can I
change the parameters underlaying data type to for example
a simple string datatype instead of a date/time? For example
TIB_Column.SQLType is a read only property and therefore
can't be changed.

I simply want that IBO treats the date/time parameter as
string type, so that no date/time checks, based on regional
settings, are used.

Thank you,