Get Server Date & Time from Client Machine
Hello,
I am developing a multiuser application where in the s/w would be running on various machines.
Is there any way by which I can get the Servers Date and time from the Client machine. I would be knowing the Server Name in the program.
Is this possible?
What controls I need to use for this?
Pls help...
Regards.
Re: Get Server Date & Time from Client Machine
What language is your front end developed in?
Re: Get Server Date & Time from Client Machine
My Front end is developed in VB6 and back end is in Access.
Re: Get Server Date & Time from Client Machine
But, you want the date/time of the network file server right, not your Access database.
Re: Get Server Date & Time from Client Machine
I want System Date and Time of the Server and not of the access file.
1 Attachment(s)
Re: Get Server Date & Time from Client Machine
If we can assume these systems are all in the same Workgroup or Domain there is a fairly simple way to get the information by calling NetRemoteTOD() of the netapi32.dll library.
I dug up an old example/demo and have attached it.
Edit:
I should add that this probably won't work at all for asking a Win9x machine it's current time and date. Also if you call NetRemoteTOD() on an NT 4.0 (or earlier) system the server name must be in UNC form, i.e. preceded by two \ characters:
\\BigServer
On newer systems (Win2K and later) you can use either a DNS name or a NetBIOS name, and you do not need the leading "\\" symbols.
http://msdn2.microsoft.com/en-us/library/aa370612.aspx
Re: Get Server Date & Time from Client Machine
Thanks dilettante for your support.
Re: Get Server Date & Time from Client Machine
Thanks dilettante for your support. i will check it out.