sql - What is same as TIMESTAMP datatype in Access? -


for auto date\time use timestamp datatype in sql. equivalent datatype in ms access 2007...

there no exact equivalent in access.
clarify, timestamp in sql not usable date/time, instance in sql server deprecated , equivalent rowversion, returns unique value , not used track date , time, though value loosely derived current time.

but let's want track changes records.
in access, following ways let set field datetime automatically:

first, can assign =now default value datetime field in table. assign current time when record created (but not update automatically when record changed).

for recording current datetime whenever make change, have program in vba or through macros:

  • when going through recordset, update !modifieddatetime or (whatever called field) whenever make change record.

  • when table/query bound form, can let form update modifieddatetime field handling beforeupdate event of form:

    private sub form_beforeupdate(cancel integer)     modifieddatetime = end sub 

if use query rather table bind form, make sure field present in query.

in access 2010 , later, may use new data macro, access equivalent of triggers, record current date , time when record changes.
less portable, more reliable using vba since don't have remember code whenever modify record (data macros handled @ ace database driver level).

there tons of articles on how create audit trails in access if looking for.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -