Date/Timestamp Sync

Gannet

Registered User.
Local time
Today, 09:50
Joined
Sep 21, 2006
Messages
55
I have two questions the first is code related and the other is design.

1st:
I need a way to sync up to a trusted external time source such as time.nist.gov via VBA code.

2nd:
Since I'm looking to develop an audit trail I need a way to get time and date that cannot be tampered with by the user. I was thinking of a hidden form that would open when the database was opened. The code from my first question would be executed and would keep a clock running for the duration of the database session. This clock would be referenced when date/timestamping vs using Now(). Any ideas?
 
Ok I've got something that is working. I had to add a reference to MSWINSCK.OCX to use the winsock activeX control.

I'm having an issue though when I try to sync via internet servers. When I click the sync button under the internet section it messes up my system clock even though it returns a proper time in the listbox.

I know exactly where it occurs but not why.

When this code is executed it happens:
Code:
'and call the API with the new date & time
      If SetSystemTime(ST) Then

*Note that for the UNC Sync it will need to be changed to look for an NTP server on your network.
 

Attachments

OK, found a solution

OK, some of the functions used with the UNC and Internet servers were the same so I thought I would reuse them for both. The problem I ran into was caused by this or rather my lack of understanding of how the functions worked.

My quick and dirty solution was to make two copies of the functions. One set each for UNC and Internet syncing. This works fine.
 

Attachments

Users who are viewing this thread

Back
Top Bottom