Solved

Retrieve NT Server time over network from 95 machine.

Posted on 1998-10-15
9
144 Views
Last Modified: 2012-05-04
How can I retrieve the current TOD on the NT server (or any other machine connected to the network for that matter) from a 95 machine ?
0
Comment
Question by:TAD062998
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 

Expert Comment

by:sjrl
ID: 1440054
Excuse my naivety, but what do you mean by TOD?
0
 
LVL 4

Expert Comment

by:mcix
ID: 1440055
0
 
LVL 4

Expert Comment

by:mcix
ID: 1440056
0
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
LVL 2

Accepted Solution

by:
Poddy earned 50 total points
ID: 1440057
This should do the trick

The RAdmin32 dll is part of the remote administration tools set if you don't have it installed (it also needs RLocal32 installed)

Private Declare Function NetRemoteTOD Lib "Radmin32.dll" Alias "NetRemoteTODA" (ByVal pstrServerName As String, rptrTodi As Long) As Long


Private Type TimeOfDayInfo
  tod_Elapsedt As Long
  tod_MSecs As Long
  tod_Hours As Long
  tod_Mins As Long
  tod_Secs As Long
  tod_Hunds As Long
  tod_Timezone As Long
  tod_TInterval As Long
  tod_Day As Long
  tod_Month As Long
  tod_Year As Long
  tod_Weekday As Long
End Type

Private Function GetTODI(ByVal pstrServerName As String, rtypTODI As TimeOfDayInfo) As Boolean
  Dim intLoop As Integer   ' Size of Time_Of_Day structure
  Dim lngRet As Long    ' result value
  Dim lngToad As Long
      ' Get Time of Day Structure
    lngRet = NetRemoteTOD(pstrServerName, lngToad)
        ' If Ok
      If lngRet = 0 Then
          ' Move result data to structure
        CopyMemory rtypTODI, lngToad, LenB(rtypTODI)
        GetTODI = True
      Else
        GetTODI = False
      End If
End Function
0
 
LVL 2

Expert Comment

by:Poddy
ID: 1440058
You'll need this as well !

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long)

0
 
LVL 2

Expert Comment

by:Poddy
ID: 1440059
You'll need this as well !

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, ByVal hpvSource As Long, ByVal cbCopy As Long)

Also, watch out for time zone/summer time adjustments

0
 

Author Comment

by:TAD062998
ID: 1440060
For sjrl - Time Of day.
For mcix - The site you suggested and code written by Jim Huff makes use of TCP/IP which poses a problem as the site where I wish to implement this functionality is running peer-peer at the moment with the hopes of placing a NT Server as domain controller. To the best of my knowledge, the individual machines will not have IP addresses. This will, however, have to be investigated a bit further.
For Poddy - I would appreciate your patience before I accept/grade the answer as the local server I'm testing on does not have Remote Access Administration installed. I'll be able to test the code once this has been done (the machine does not belong to me so this may take some time). P.S. The site indicated by mcix addresses the problem of timezones and daylight saving.
0
 
LVL 2

Expert Comment

by:Poddy
ID: 1440061
I don't think you need to install the remote access on the server, simply on the Windows 95 client

In fact, all you need on the client is the two DLLs.


0
 

Author Comment

by:TAD062998
ID: 1440062
I must apologise for my late return but I've been unable to get my hands on the required Dll's for Remote Access Administration. I'll accept the answer before it is auto-accepted by the system in the hope that it is correct when I do eventually get a chance to test it.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month10 days, 5 hours left to enroll

623 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