Getting SysDate from back end PC instead of front end PC?

P

(PeteCresswell)

This is just idle curiosity... but it seems like date/time
stamping updates in an app would best be done using Now() from
the PC (presumably a LAN file server) that the back end is
located on instead of the user's PC (on which the front end would
be running).

That would prevent somebody from back-dating a transaction by
changing their PC's Date/Time.... without going to the trouble of
making sure every user's PC is locked down in that respect.

Anybody do this as a matter of SOP?

If so, is there a "best" way to do it?
 
J

Jeff Boyce

Pete

Hire ... less-sophisticated users? <g>

(Consider checking in with your Network Admins to see if they can set a
policy that disallows the user changing the system date/time.)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
P

Pete D.

Perfect answer, thanks I needed that, Pete D
Jeff Boyce said:
Pete

Hire ... less-sophisticated users? <g>

(Consider checking in with your Network Admins to see if they can set a
policy that disallows the user changing the system date/time.)

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jeff Boyce

Pete

Actually, there is something you could experiment with...

If you create a function in the back-end that returns the Now() value, then
call that function from the front-end after setting a reference to the
back-end (or to a small applet that also lives on the back-end server), it
just might get around a user-modified PC current date/time. No promises,
and I haven't tested this...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
R

RoyVidar

(PeteCresswell) said:
This is just idle curiosity... but it seems like date/time
stamping updates in an app would best be done using Now() from
the PC (presumably a LAN file server) that the back end is
located on instead of the user's PC (on which the front end would
be running).

That would prevent somebody from back-dating a transaction by
changing their PC's Date/Time.... without going to the trouble of
making sure every user's PC is locked down in that respect.

Anybody do this as a matter of SOP?

If so, is there a "best" way to do it?

I once created/modified a text file in the same directory as the
BE, then read the last modified date from it.

If I were to try today, I'd probably investigate some APIs. Not
that I've tried, but you could see if for instance this
http://vbnet.mvps.org/index.html?code/network/netremotetod.htm
works.
 
P

(PeteCresswell)

Per Jeff Boyce:
Actually, there is something you could experiment with...

If you create a function in the back-end that returns the Now() value, then
call that function from the front-end after setting a reference to the
back-end (or to a small applet that also lives on the back-end server), it
just might get around a user-modified PC current date/time. No promises,
and I haven't tested this...

Thanks Jeff. Thanks Roy.

I'm a *teeny* bit surprised that nobody's given me a dope slap
and said I sb using SQL Server as my back end if things are that
critical... -)
 
P

(PeteCresswell)

Per (PeteCresswell):
I'm guessing it's fairly straightforward to avoid a hard-coded or
parmed server name by getting the name of the PC that the back
end is running on.

Or is "Server" some special class of PC - and the back end could
be running on a "Non-Server" PC?
 
D

Douglas J. Steele

If you're dealing with a peer-to-peer network, then the backend could be on
a workstation as opposed to a server, and that code likely wouldn't work.
(To be honest, I've never tried it against an XP workstation: it's possible
it might work)

In a situation where you've got a server, you can look at the Connect
property of a linked table to locate where the backend's located. If the
mapping took place using a mapped drive as opposed to a UNC, check
http://www.mvps.org/access/api/api0003.htm at "The Access Web" for how to
translate from a mapped drive to a UNC. (Hopefully you already know how to
derive the server name from a UNC)
 
T

Tony Toews [MVP]

Jeff Boyce said:
Actually, there is something you could experiment with...

If you create a function in the back-end that returns the Now() value, then
call that function from the front-end after setting a reference to the
back-end (or to a small applet that also lives on the back-end server), it
just might get around a user-modified PC current date/time. No promises,
and I haven't tested this...

A function which resides on the server wouldn't work as you would be
executing it on the client.. You'd have to go with the small applet
that lives on the server. Although there should be an API call. And
RoyVidar has found it.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

(PeteCresswell) said:
Or is "Server" some special class of PC - and the back end could
be running on a "Non-Server" PC?

That shouldn't matter. So long as both the client and the "server"
are Windows NT or better then it should work just fine. But not Win
95/98 or ME.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top