ACC: Cannot Set System Time in MS Windows NT 3.5

ID: Q131935

The information in this article applies to:

SYMPTOMS

Moderate: Requires basic macro, coding, and interoperability skills.

On a computer running Microsoft Windows NT version 3.5, if you set the time using the Time statement in Access Basic, the computer's system time is not changed.

CAUSE

In Windows NT version 3.5, you cannot set the computer's system clock from within a 16-bit application.

STATUS

Microsoft has confirmed this to be a problem in Microsoft Windows NT version 3.5. This problem no longer occurs in Microsoft Windows NT version 3.51.

MORE INFORMATION

In Windows NT version 3.5, each virtual MS-DOS machine (VDM) keeps track of its own time. When a 16-bit application changes the time, it affects only that VDM because 16-bit applications cannot change the system time.

In Windows NT version 3.1, the Time statement can change the time setting for Microsoft Access and other 16-bit Windows-based programs (all running in the same VDM), but the Time statement cannot change the time setting for 32-bit applications, the operating system, or other VDMs running MS-DOS- based programs.

In Windows NT version 3.51, using the Time statement in a 16-bit application does set the time for the VDM as expected; the Time statement returns the time from the system clock rather than the time from the VDM's clock.

Steps to Reproduce Problem

1. Start Microsoft Access in Windows NT version 3.5, and open the sample

   database NWIND.MDB.

2. Open any module, type the following line in the Immediate window,
   and then press ENTER:

      ? time

   Note the time that appears in the Immediate window.

3. To change the time for the VDM running Microsoft Access, type the
   following line in the Immediate window, and then press ENTER:

      Time="10:00:00 am"

4. To see if the Time statement set the system clock, type the following
   line in the Immediate window, and then press ENTER:

      ? time

   Note that the time returned does not match the time you set in
   step 3.

REFERENCES

For more information about the Time statement in Access Basic, search for "time," and then "Time, Time$ Statements" using the Microsoft Access 2.0 Help menu.

Keywords          : kbenv
Version           : 1.0 1.1 2.0
Platform          : WINDOWS
Hardware          : x86
Issue type        : kbbug
Solution Type     : kbfix

Last Reviewed: April 28, 1998