Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compare datetime() of each computer
Message
From
18/06/2021 02:03:50
 
 
To
18/06/2021 01:43:44
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
01681219
Message ID:
01681349
Views:
38
So how does your connectionstring look like, you use localhost or server IP? Normally I would expect the MySql engine to be installed only on the server, where the data folder is.

>>But that would mean that MySql is running on your local computer, and not on a server. Is this a test environment or you did that in the production environment?
>
>The database is in the server, while MySQL engine is installed in all PCs (server and clients).
>
>
>
>>>>Nope. DateTime() is vfp=client, the others are coming from the SQL server. Log both in the same record - changes of local computer date will be obvious. Also perhaps add server side incremental sequential nr which allows you trace added records from another angle.
>>>
>>>I changed the Windows' date to 01/01/2020 10:00
>>>when I test in MySQL Query Browser:
>>>
>>>Select curdate()
>>>Select localtime()
>>>
>>>it shows 01/01/2020 10:00, not the real datetime
>>>
>>>Jerry
>>>
>>>
>>>>>But
>>>>>
>>>>>Select curdate()
>>>>>Select localtime()
>>>>>
>>>>>is the same as
>>>>>
>>>>>datetime()
>>>>>
>>>>
>>>>Nope. DateTime() is vfp=client, the others are coming from the SQL server. Log both in the same record - changes of local computer date will be obvious. Also perhaps add server side incremental sequential nr which allows you trace added records from another angle.
>>>>
>>>>>What happens is the operators try to cheat by entering the invoice with back date, hence it's hard to detect. I disabled the invoice date, but they can easily change the computer date so the protection is useless.
>>>>>
>>>>>The other way is to compare the datetime() from the client vs the server. because the server is secure and the datetime() is always correct.
>>>>>
>>>>>This is in LAN environment and not necessary connect to internet.
>>>>>
>>>>>Thanks for the help
>>>>>
>>>>>Jerry Yang
>>>>>
>>>>>
>>>>>>In addition to Christians hint, it might be better to add 2 timestamp colums to each CUD statement: timestamp as is set in MySQL and datetime() as set in vfp on client machine. Client time could be altered after program start ;-))
>>>>>>
>>>>>>
>>>>>>>>Just create a file on the server, and check its datetime with Adir().
>>>>>>>
>>>>>>>This is a good idea, but I also have a problem.
>>>>>>>The folder in the server must be R/W in order to be able to write.
>>>>>>>
>>>>>>>While I'm using VFP9 with MySQL database, no need to share the server's folder.
>>>>>>>The server's folder remains ReadOnly
>>>>>>>
>>>>>>>Jerry Yang
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>>in the LAN environment, is there a way to know the server's datetime()?
>>>>>>>>>
>>>>>>>>>My client has an issue, the operator changes the clock so he can enter old invoices.
>>>>>>>>>My client want to each time the cashiers login, the program will compare the datetime() with the server's datetime()
>>>>>>>>>
>>>>>>>>>Thanks for the help
>>>>>>>>>
>>>>>>>>>Regards,
>>>>>>>>>
>>>>>>>>>Jerry Yang
>>>>>>>>
>>>>>>>>Just create a file on the server, and check its datetime with Adir().
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform