Windows Vista - Set Time

Windows Vista - Set Time

am 22.10.2007 16:52:09 von animedreamer

Due to UAC under Vista, I am encountering an error (Access Denied)
when trying to set the system time from my Access application. How do
I prompt for the necessary privilege elevation to allow me to modify
the system time? Thank you for your assistance.

Vincent

Re: Windows Vista - Set Time

am 24.10.2007 04:30:25 von Tony Toews

Vincent wrote:

>Due to UAC under Vista, I am encountering an error (Access Denied)
>when trying to set the system time from my Access application. How do
>I prompt for the necessary privilege elevation to allow me to modify
>the system time?

Why would you want to set the system time from within an Access app?

I don't see how you can do this within Access without somehow elevating Access's
privileges. Possibly on the shortcut calling Access and/or your FE MDB/MDE.
However even then you might need to have an administrator log onto your system.

One alternative might be to a VB 6 or VB.Net program. But again you might have to do
some very interesting priviliged things.

Can a regular user change the time on Vista without going through UAC or being an
administrator?

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/

Re: Windows Vista - Set Time

am 26.10.2007 18:37:23 von animedreamer

On Oct 23, 10:30 pm, "Tony Toews [MVP]"
wrote:
> Vincent wrote:
> >Due to UAC under Vista, I am encountering an error (Access Denied)
> >when trying to set the system time from my Access application. How do
> >I prompt for the necessary privilege elevation to allow me to modify
> >the system time?
>
> Why would you want to set the system time from within an Access app?
>
> I don't see how you can do this within Access without somehow elevating Access's
> privileges. Possibly on the shortcut calling Access and/or your FE MDB/MDE.
> However even then you might need to have an administrator log onto your system.
>
> One alternative might be to a VB 6 or VB.Net program. But again you might have to do
> some very interesting priviliged things.
>
> Can a regular user change the time on Vista without going through UAC or being an
> administrator?
>
> 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 athttp://www.granite.ab.ca/accsmstr.htm
> Tony's Microsoft Access Blog -http://msmvps.com/blogs/access/

Tony,

No user can change the system time without going through UAC. I
wanted to set the system time because our application is being
utilized as a POS application and we often reference the system time.
For example, if an employee is about to clock in, we want to make sure
they are being clocked in at the actual time. We can still retrieve
the actual time by contacting a server on the Internet, but it would
be nice to be able to update the system clock as well. From what I
have read, it does not appear you can elevate the privileges of an
application that is already running. I think your suggestion to shell
out to a VB app would probably be the easiest solution.

Re: Windows Vista - Set Time

am 27.10.2007 03:31:59 von Tony Toews

Vincent wrote:

> No user can change the system time without going through UAC. I
>wanted to set the system time because our application is being
>utilized as a POS application and we often reference the system time.
>For example, if an employee is about to clock in, we want to make sure
>they are being clocked in at the actual time. We can still retrieve
>the actual time by contacting a server on the Internet, but it would
>be nice to be able to update the system clock as well. From what I
>have read, it does not appear you can elevate the privileges of an
>application that is already running. I think your suggestion to shell
>out to a VB app would probably be the easiest solution.

Then maybe you're best off seeing when the last time Windows, be it XP or Vista,
updated the system time. For example I will occasionally see such messages in the
event log telling me the time was or was not updated succesfully. I suspect there
may be some API calls which would suffice.

Then if the time is too long then fire up a message and/or notify the app
administrator.

Also you can get the time of the server where the back end resides. Either use that
or compare it to the time on the PC.

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/

Re: Windows Vista - Set Time

am 27.10.2007 03:40:30 von Tony Toews

"Tony Toews [MVP]" wrote:

>Then maybe you're best off seeing when the last time Windows, be it XP or Vista,
>updated the system time. For example I will occasionally see such messages in the
>event log telling me the time was or was not updated succesfully. I suspect there
>may be some API calls which would suffice.
>
>Then if the time is too long then fire up a message and/or notify the app
>administrator.

However I don't see such an API call at vbnet.mvps.org.

>Also you can get the time of the server where the back end resides. Either use that
>or compare it to the time on the PC.

The following code synchronizes the date and time but by removing one line it will
just read the server date and time.
Synchronizing Date and Time to a Remote Server
http://vbnet.mvps.org/index.html?code/network/netremotetodsy nc.htm

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/