Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Get current datetime on datebase computer.

Posted on 2003-11-06
6
Medium Priority
?
385 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

773 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