dbTalk Databases Forums  

Retrieve Server Date and Time

comp.databases.ms-access comp.databases.ms-access


Discuss Retrieve Server Date and Time in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
john@kosmosbusiness.com
 
Posts: n/a

Default Retrieve Server Date and Time - 03-26-2009 , 10:52 AM






I am using Access 2003 and would like to be able to retrieve the Date
and Time of the PC where the backend MDB is stored, from the front
ends (MDE) which would reside on different PCs.

Any ideas.

John

Reply With Quote
  #2  
Old   
Salad
 
Posts: n/a

Default Re: Retrieve Server Date and Time - 03-26-2009 , 12:22 PM






john (AT) kosmosbusiness (DOT) com wrote:
Quote:
I am using Access 2003 and would like to be able to retrieve the Date
and Time of the PC where the backend MDB is stored, from the front
ends (MDE) which would reside on different PCs.

Any ideas.

John
There is a link at http://www.mvps.org/access/api/api0039.htm. However,
it's for NT. I figure, from this code, that it would be an API call.
Perhaps look for an API in google or google groups for determining it.


Reply With Quote
  #3  
Old   
john@kosmosbusiness.com
 
Posts: n/a

Default Re: Retrieve Server Date and Time - 03-26-2009 , 12:45 PM



You are right on both counts. An API that can be used is NetRemoteTOD
as indicated in the call below.

p_lngRtn = NetRemoteTOD(yServer:=p_abytServerName(0),
pBuffer:=p_lngPtrBuffer)

However there is a 5-6 second delay when invoked, which is
unacceptable.

Any ideas?

John

Reply With Quote
  #4  
Old   
Salad
 
Posts: n/a

Default Re: Retrieve Server Date and Time - 03-26-2009 , 01:18 PM



john (AT) kosmosbusiness (DOT) com wrote:

Quote:
You are right on both counts. An API that can be used is NetRemoteTOD
as indicated in the call below.

p_lngRtn = NetRemoteTOD(yServer:=p_abytServerName(0),
pBuffer:=p_lngPtrBuffer)

However there is a 5-6 second delay when invoked, which is
unacceptable.

Any ideas?

Nope. You asked how to get the time. However...

I have no idea if this would work. What would happen if you wrote a
file to that server. (Fopen, Fwrite, Print #, Fclose, etc). Just a one
line file. Then did a dir on that file and determined the the timestamp
of the file. Ex from A97 help
Dim MyStamp
' Assume TESTFILE was last modified on February 12, 1993 at 4:35:47 PM.
' Assume English/U.S. locale settings.
MyStamp = FileDateTime("TESTFILE") ' Returns "2/12/93 4:35:47 PM".
'my addition so you leave the folder uncluttered.
Kill "Testfile"

I assume it would be a timedate on the other computer, not the local one
that invoked the file creation. Of course, one would need network
rights to create the file for testing.
Quote:
John

Reply With Quote
  #5  
Old   
john@kosmosbusiness.com
 
Posts: n/a

Default Re: Retrieve Server Date and Time - 03-26-2009 , 01:42 PM



Excellent. This is exactly the functionality I am looking for. In
other words when I write to the backend I need that timestamp inserted
in the front end.

Great lateral thinking.

John


Reply With Quote
  #6  
Old   
Tony Toews [MVP]
 
Posts: n/a

Default Re: Retrieve Server Date and Time - 03-26-2009 , 05:09 PM



Salad <oil (AT) vinegar (DOT) com> wrote:

Quote:
There is a link at http://www.mvps.org/access/api/api0039.htm. However,
it's for NT. I figure, from this code, that it would be an API call.
Perhaps look for an API in google or google groups for determining it.
FWIW the first place I look for API stuff is at vbnet.mvps.org. Rather than doing
what is usually a useless search with too many useless hits from Google as Google now
indexes every online forum which is a mirror of the NNTP newsgroups.

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/


Reply With Quote
  #7  
Old   
Albert D. Kallal
 
Posts: n/a

Default Re: Retrieve Server Date and Time - 03-27-2009 , 03:47 AM



"Salad" <oil (AT) vinegar (DOT) com> wrote


Quote:
There is a link at http://www.mvps.org/access/api/api0039.htm. However,
it's for NT.
The above works if you have just about any kind of windows box (windows xp
for example).

I not sure if the server can be windows xp home, but it works for xp pro.
And in fact I have clients of mine in which their server is a linx box (that
means Samba - and again it works).

So, virutally just about any office setup with a sewrver will work.

And, I found there not a big delay when you use this api...

So, it not limited to NT and just about any windows box after NT also
supports that api...

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal (AT) msn (DOT) com




Reply With Quote
  #8  
Old   
Salad
 
Posts: n/a

Default Re: Retrieve Server Date and Time - 03-27-2009 , 08:21 AM



Albert D. Kallal wrote:

Quote:
"Salad" <oil (AT) vinegar (DOT) com> wrote in message
news:ksOdnX3rPsJhWlbUnZ2dnUVZ_rfinZ2d (AT) earthlink (DOT) com...


There is a link at http://www.mvps.org/access/api/api0039.htm. However,
it's for NT.


The above works if you have just about any kind of windows box (windows xp
for example).

I not sure if the server can be windows xp home, but it works for xp pro.
And in fact I have clients of mine in which their server is a linx box (that
means Samba - and again it works).

So, virutally just about any office setup with a sewrver will work.

And, I found there not a big delay when you use this api...

So, it not limited to NT and just about any windows box after NT also
supports that api...

Thanks for the update. The OP mentioned it took about 5-6 seconds to
run on his PC which made it unacceptable...why it took so long is beyond
me...maybe it's a wan?


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.