Microsoft KB Archive/131935

= ACC: Cannot Set System Time in MS Windows NT 3.5 =

Article ID: 131935

Article Last Modified on 5/7/2003

-

APPLIES TO


 * Microsoft Access 1.0 Standard Edition
 * Microsoft Access 1.1 Standard Edition
 * Microsoft Access 2.0 Standard Edition

-



This article was previously published under Q131935



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



SYMPTOMS
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
 Start Microsoft Access in Windows NT version 3.5, and open the sample database NWIND.MDB. 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. 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"

 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.

<div class="references_section">