Solved

Get current datetime on datebase computer.

Posted on 2003-11-06
6
328 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
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
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

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)

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
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…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

757 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

19 Experts available now in Live!

Get 1:1 Help Now