How to close the application if timezones changes

I have a ms access appliaction. Its in inside vdi. That application is about to enter the production data and it should get the production data in end of the day. But the challenge is, user can able to change the  vdi time zone. If they are changing the timezone then the application should not work. I'm using ms access 2007 . Can any one help me to fix this issue.
Shinal KAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
the application should not work

Why? And what is "not work"?
0
PatHartmanCommented:
I'm not sure what vdi is and why would the user ever change his timezone?   What advantage would that give him with this application?

If the application should only work in a specific time zone, (why?) then set that as a parameter in a table and compare the timezone of the PC when the app opens.  If they are different, you can close the app.
0
David Johnson, CD, MVPOwnerCommented:
datetimes are always stored internally as seconds after a specific date time. You use the user environment settings to set how it is displayed on the screen.

Why are you developing for a product that has reached end of life (as of October 10th, 2017) ?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Dr. KlahnPrincipal Software EngineerCommented:
A program can get the Windows time zone information from the Windows Registry.  The time zone keys and how to use them are discussed at the page below:

https://blogs.msdn.microsoft.com/bclteam/2007/06/07/exploring-windows-time-zones-with-system-timezoneinfo-josh-free/

Per PatHartman supra, let the application read the TZ information when the program is installed, save that somewhere that the user is unlikely to find it, and then when the program starts up forever after check the current TZ against the TZ at install time.  But, imo, it seems to me a solution in search of a problem.  It's unlikely that a user would ever change a system's time zone.
0
Gustav BrockCIOCommented:
You can find the current timezone using this function, LocalTimeZoneDescription:

Option Explicit

    Public Type SystemTime
        wYear                           As Integer
        wMonth                          As Integer
        wDayOfWeek                      As Integer
        wDay                            As Integer
        wHour                           As Integer
        wMinute                         As Integer
        wSecond                         As Integer
        wMilliseconds                   As Integer
    End Type

    ' TimeZoneInformation holds information about a timezone.
    ' The two arrays are null-terminated strings, where each element
    ' holds the byte code for a character, and the last element is a
    ' null value, ASCII code 0.
    Private Type TimeZoneInformation
        Bias                            As Long
        StandardName(0 To (32 * 2 - 1)) As Byte     ' Unicode.
        StandardDate                    As SystemTime
        StandardBias                    As Long
        DaylightName(0 To (32 * 2 - 1)) As Byte     ' Unicode.
        DaylightDate                    As SystemTime
        DaylightBias                    As Long
    End Type

' Retrieves the current time zone settings from Windows.
Private Declare PtrSafe Function GetTimeZoneInformation Lib "Kernel32.dll" ( _
    ByRef lpTimeZoneInformation As TimeZoneInformation) _
    As Long


' Returns the localized friendly description of the current timezone.
'
' 2016-06-09. Gustav Brock, Cactus Data ApS, CPH.
'
Public Function LocalTimeZoneDescription() As String

    Dim TzInfo      As TimeZoneInformation
    Dim Description As String
    
    Select Case GetTimeZoneInformation(TzInfo)
        Case TimeZoneId.Unknown
            Description = "Cannot determine current time zone"
        Case TimeZoneId.Standard
            Description = TzInfo.StandardName
        Case TimeZoneId.Daylight
            Description = TzInfo.DaylightName
        Case TimeZoneId.Invalid
            Description = "Invalid current time zone"
    End Select
    
    LocalTimeZoneDescription = Split(Description, vbNullChar)(0)
   
End Function

Open in new window

0
Dirk KotteSECommented:
if the application (or an internal policy) does not tolerate time zone change this, i would deny time zone change at VDI level.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Gustav BrockCIOCommented:
No response, but ideas provided.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.