Board index » delphi » Interbase, ODBC & Time

Interbase, ODBC & Time

The app that I am working on requires two time fields to be held on a table.
The database is Interbase 4.2.
I have defined the fields as 'date', but how can I insert the time into it,
using ODBC? The standard {t '08:00:00'} generates an error.

Thanks

Barbara

 

Re:Interbase, ODBC & Time


Quote
> The app that I am working on requires two time fields to be held on a table.
> The database is Interbase 4.2.
> I have defined the fields as 'date', but how can I insert the time into it,
> using ODBC? The standard {t '08:00:00'} generates an error.

Time is an illusion.  Interbase doubly so.

You will probably need to add the date as well to your string, but
ignore it in your computations.

Alternatively, you could try assign field values in delphi code, eg:

        with Table1 do begin
                Edit;
                Field1Time.AsDateTime:=StrToTime('08:00:00');
                ...
                Post;
        end;

Why are you interfacing to Interbase via ODBC?  It works fine with the
native SQL-Links interface provided with Delphi.

Oliver

Other Threads