Solved

Get current datetime on datebase computer.

Posted on 2003-11-06
6
339 Views
Last Modified: 2008-03-10
Hi experts
I use VB to connect to MSAccess DB on another computer named \\DB.
Now I want to save current datetime of \\DB in MSAcess DB.
Who can help me?
0
Comment
Question by:rock2003
6 Comments
 
LVL 8

Expert Comment

by:HaydnH
ID: 9699868
I don't know of anyway to specifically get the time of the other computer. However, a quick "workaround" would be to run a query that returns Now():

    SELECT Now() As MyDate FROM SomeSmallTable;

I'm guessing that the Now() function would run on the remote system returning the \\DB's time.

NOTE: I said "SomeSmallTable" for obvious reasons - the smaller the table you're querying the better performance you will get.

Haydn.
0
 
LVL 4

Expert Comment

by:inox
ID: 9700576

do you have access to the other computer, I mean are there directory shares is there Access or Excel installed and can you put a small piece of code there (i.e. Excel-/Accessmakro)?
0
 
LVL 8

Expert Comment

by:HaydnH
ID: 9700659
If you can access the computer over a network drive you could create file on that netowrk drive using CreateTextFile and then use FileDateTime to determine that systems date/time.

Haydn.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
LVL 4

Expert Comment

by:inox
ID: 9700746

you can also query the date/time of another computer (w/o changing something on that) by executing

 Shell "cmd /C net time \\DB > %temp%\AnotherComputersDate.txt", vbHide

then read AnotherComputersDate.txt in your temp directory
0
 
LVL 32

Expert Comment

by:jadedata
ID: 10022961
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

PAQ - no points refunded

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jadedata
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 10060133
PAQed, with points refunded (100)

SpazMODic
EE Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Today's users almost expect this to happen in all search boxes. After all, if their favourite search engine juggles with tens of thousand keywords while they type, and suggests matching phrases on the fly, why shouldn't they expect the same from you…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

937 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

4 Experts available now in Live!

Get 1:1 Help Now