Subject Re: [ib-support] previleges according to date
Author Helen Borrie
>At 11:23 AM 12/28/2002 +0000, duilio_fos <irel_llc@...> wrote:
>
> >Normal users will be able to insert/delete/modify rows thru SPs.
> >
> >These SPs will check the field date value against the current date.

At 03:54 PM 28/12/2002 -0500, Ann H wrote:

>It might be easier to define views for normal users that are restricted
>to the set of records they can access. As generally noted, the database
>uses the system date from the server, not the client machine date, so
>your concern about a normal user changing the local date is probably
>not relevant.

It *would* be of concern if the application were passing the client date as
a parameter. I think Dulio is using Delphi...the following, for example,
using Delphi's system variable for machine time, will be out of sync with
the server:

MyQuery.ParamByName('TransactionDate').AsDateTime := Now;

As already suggested, you need to read the server date, once the procedure
call or DSQL statement reaches the server. If you are using IB 5.x, use a
date literal ('NOW' or 'TODAY'); with Fb dialect 1 use CAST ('NOW' as
timestamp), with dialect 3 the same, or you can use the context variable
CURRENT_TIMESTAMP.

cheers,
heLen