Question : Access Frontend MySQL Timestamp error

Hi,

current setup is Access front end with MySQL backend. The timestamp field in the database has a datatype of "timestamp" and a default vaule of "current_timestamp". In access the timestamp field is being updated by an on dirty event  "Me!Time_Stamp.Value = Now()"

All was working fine. I have made some changes to tables so I re-linked the tables and now a forms that were working are not. I get the error:

Runtime error 3327
Field 'Time_Stamp' is based on an expression and cannot be edited.

Now I have an older copy of the same access frontend and this still works fine. So its only when relinking the tables that an error appears. As the old one still works, the MySQL database I presume is not at fault.

Does anyone have any ideas?

Answer : Access Frontend MySQL Timestamp error

AFAIK, you cannot update a field in your MySQL table that is a TimeStamp datatype. Either let the server handle this, or set that MySQL field to have no default value and manage it through your UI.

Note you can also have the MySQL TimeStamp column be an "auto update" column, which would eliminate your need to use the Dirty event:
http://dev.mysql.com/doc/refman/5.0/en/timestamp.html

Finally, assuming this would be a multiuser system, it would be far better IMO to allow the server to handle this. Different machines can easily have different "system times", so if your intent is to have some sort of timeline, the server-based scenario is the way to go.

Also note the first portion of the link where it describes differences with versions of MySQL in regard to the TimeStamp column. This may be where your issue is coming from.
Random Solutions  
 
programming4us programming4us